Factorization of Boundary Value Problems Using the Invariant Embedding Method