Least-Squares Solutions of Generalized Sylvester Equation with Xi