Time dependent density functional theory of X-ray absorption spectroscopy of alkaline-earth oxides.