X-ray magnetic and natural circular dichroism from first principles: Calculation of K - And L1 -edge spectra