X-rays is a kind of electromagnetic wave in a particular wavelength range in the electromagnetic spectrum, the characteristic of which is usually descripted by the energy (Unit: thousands of electron volts, keV) and wavelength (Unit: nm).
X-ray fluorescence is a phenomenon caused by the changes within the atom. The structure of a stable atomic consist of nucleus and extranuclear electrons. Its extranuclear electrons move on their fixed orbits by their unique energy, the inner electrons (such as K layer) can get rid of their atoms in the irradiation of sufficient energy X-rays, and the released electrons can cause a electron vacancy in the electron shell. At this point, the electrons in the high-energy electron shell (eg: L layer) will transit to the low-energy electron shell to fill the corresponding electron vacancy. As there is big energy gap between the electron shell which will released in the form of secondary X-rays, the secondary X-rays released by the different elements has specific energy characteristics. And this process is that we call the X-ray fluorescence (XRF).
The energy and wavelength of characteristic X-ray emitted by different elements is not the same. So, by measuring the energy and wavelength of X-rays, we can know it is sent by which element, and make the qualitative analysis of elements. At the same time, the intensity of the characteristic X-rays irradiate by the sample after excited is related to the content of the element in the sample, therefore, you can make quantitative analysis of elements by measuring its intensity.
Therefore, X-ray fluorescence spectrometer, there are two basic types: Wavelength dispersive (WD-XRF) and energy dispersive (ED-XRF)