X-Ray Constrained Wave Functions: Fundamentals and Effects of the Molecular Orbitals Localization