Abstract: The invention relates to a method for defining element contents contained by solid, liquid or slurry-like materials by means of an X-ray fluorescence method in an online analysis. According to the invention a combination of both the energy dispersive (3) and wave dispersive (2) X-ray fluorescence methods are applied in the method, so that by means of the energy dispersive method (3), there are measured such diffraction lines that are located essentially far from each other, whereas by means of the wave dispersive method (2), there are measured such diffraction lines that are located essentially near to each other as well as such diffraction lines where a high resolution and resulting accuracy and sensitivity are required.