CASTEP can calculate spectra involving transitions between core and conduction states (ELNES, XANES). Core-hole effects can be taken into account by using supercells and pseudopotential generated with a reduced occupancy.
CASTEP can also compute the complex dielectric function with the random phase approximation (neglecting local field effects). This can be used to obtain the refractive index and optical conductivity. It can also be used to obtain the loss function, providing a connection to low-loss EELS.
For more information on Core-loss and Optical properties in CASTEP see the following talks:
Theoretical core-level excited spectra with inclusion thick red line and without inclusion