  In this paper we give an extension of the Birkhoff--Lewis theorem to some
semilinear PDEs. Accordingly we prove existence of infinitely many periodic
orbits with large period accumulating at the origin. Such periodic orbits
bifurcate from resonant finite dimensional invariant tori of the fourth order
normal form of the system. Besides standard nonresonance and nondegeneracy
assumptions, our main result is obtained assuming a regularizing property of
the nonlinearity. We apply our main theorem to a semilinear beam equation and
to a nonlinear Schr\"odinger equation with smoothing nonlinearity.
