X-ray absorption spectra: K-edges of 3d transition metals, L-edges of 3d and 4d metals, and M-edges of palladium