Core-Level Spectroscopy in Condensed Systems