Data Analysis for X-Ray Spectroscopy