  X-ray spectroscopies, by their high selectivity and sensitivity to the
chemical environment around the atoms probed, provide significant insight into
the electronic structure of molecules and materials. Interpreting experimental
results requires reliable theoretical models, accounting for environment,
relativistic, electron correlation, and orbital relaxation effects in a
balanced manner. = In this work, following up on prior work for valence
processes [A. S. P. Gomes et al., Phys.\ Chem.\ Chem.\ Phys. 15, 15153 (2013)],
we present a protocol for the simulation of core excited spectra (with damped
response time-dependent density functional theory, 4c-DR-TD-DFT) and ionization
energies (with the core-valence separated equation of motion coupled cluster
theory, 4c-CVS-EOM-IP) based on the Dirac-Coulomb Hamiltonian, while
environment effects are accounted for through the frozen density embedding
(FDE) method. We showcase this approach for the uranium M$_4$-, L$_3$-edge and
oxygen K-edge of uranyl tetrachloride UO$_2$Cl$_4^{2-}$ in a host
Cs$_{2}$UO$_{2}$Cl$_{4}$ crystal. We have found that the 4c-DR-TD-DFT
simulations yield excitation spectra that very closely match the experiment for
the uranium M$_4$ and oxygen K-edges, with good agreement for the broad
experimental spectra for the L$_3$-edge. By investigating the sensitivity of
spectral shapes to the lifetimes, and by decomposing each peak into its
components, we have been able to correlate our results with angle-resolved
spectra. We have observed that for the uranium M$_4$ edge, a simplified model
for uranyl tetrachloride-in which an embedding potential replaces the chloride
equatorial ligands-closely matches the spectral profile obtained for the uranyl
tetrachloride system.
