X ray spectroscopy