Some invariance principles for two-point boundary value problems