Ab Initio simulation of core-level spectroscopies and correlated materials