HOMOCLINIC SOLUTIONS TO INVARIANT MANIFOLDS: A VARIATIONAL APPROACH