Measuring the energies
In wavelength dispersive XRF (WDXRF) spectroscopy, X-rays are separated by means of a diffracting crystal and a detector that are placed in positions complying with Bragg's law. The placement is either by turning of a goniometer, measuring the energies one after the other (sequential) or in fixed positions, measuring the energies all at the same time (simultaneous).
The layers of a crystal act like weak reflecting mirrors for X-rays. Only if the path difference of the reflected X-rays is a whole number of wavelengths does constructive interference occur. This is described by Bragg's law:
nλ = 2dsinθ
λ: wavelength of the X-rays
d: the spacing of the layers
θ: the incident angle of the photons