Generalized X-Ray Scattering Factors