Existence of periodic solutions of nonlinear boundary value problems and the method of upper and lower solutions