A Birkhoof-Lewis type theorem for some Hamiltonian PDE's