Revealing fingerprints of valence excitons in x-ray absorption spectra with the Bethe-Salpeter equation