Title: Collapse of 3d (4f) orbitals in 2p (3d) excited configurations and its effect on the X-ray and electron spectra