X-ray Spectroscopy in Astrophysics and Neutron Capture Cross Section Measurements