Unlike the Energy Dispersive X-ray Spectroscopy (EDS) on SEM (SEM-EDS) in which the sample is excited by primary electron beam, in X-ray Fluorescence (XRF), the sample surface is excited by primary X-ray beam leading to holes generated on inner electron shells; the electrons from outer shells fill the holes during relaxation leading to emission of X-ray fluorescence characteristic of sample elements.
SEM-EDS vs XRF
XRF and EDS are very close techniques (in most cases even the same detector). However XRF is always performed with certified standards while EDS without any standards. For proper EDS analysis the system should be calibrated with certified standards.
The XRF information depth is greater than SEM-EDS. XRF usually detects elements at the ppm level, whereas EDS detection limit is typically at 0.1% level depending on the accelerating voltages applied. So for inhomogeneous bulk sample the XRF may detect extra elements.
The irradiation area in XRF is larger than EDS, so EDS may give differences at different spots for an inhomogeneous surface.
For light elements, both methods are not really good, but EDS is better. If XRF does not have vacuum chamber it will not detect light elements at all.