X-ray diffraction spectroscopy