A method of quantitative X-ray fluorescence, XRF, analysis of a sample of a specified type to measure the concentration of a plurality of elements in respective concentration ranges, the method comprising: carrying out energy dispersive XRF, ED-XRF, to measure the concentration of a selected first subset of the elements; carrying out wavelength dispersive XRF, WD-XRF, to measure the concentration of a selected second subset of the elements; wherein the elements are divided between the first and second subsets, taking into account the expected concentrations of the elements, according to a criterion to deliver a reduced overall measurement time to measure all the plurality of elements to a given precision and/or accuracy compared to using only one of the energy dispersive XRF and the wavelength dispersive XRF; wherein in the case that the peak of an element of the elements is higher than the background, the criterion for ED-XRF to be used instead of WD-XRF is given by: E ED E WD ≤ t ED t WD where E is the reciprocal of the sensitivity, E ED is the reciprocal sensitivity for ED-XRF, E WD is the reciprocal sensitivity for WD-XRF, t ED is the measurement time for the ED-XRF measurements to measure the element to the given precision and/or accuracy and t WD is the measurement time for the WD-XRF measurement to measure the element to the given precision and/or accuracy; and in the case that the peak of an element of the elements is not higher than the background the criterion is that ED-XRF is used instead of WD-XRF for elements for which: E WD r peak t peak + l bkg 1 2 r bkg 1 t bkg 1 + l bkg 2 2 r bkg 2 t bkg 2 +... ≥ E ED 1 LT ⋅ r peak t ED + r bkg t ED where r peak is the count rate at the peak position, t peak is the measurement time of the peak, r bkg1 is the count rate at a 1 st background position, t bkg1 is the corresponding measurement time, l bkg1 is the corresponding background factor, with the same for other background positions 2, 3.., wherein the background factor, l bkg1, is equal to 1 or the sum of the background factors, l bkg1, l bkg2..., is equal to 1, wherein the background factors are inversely proportional to the distance to the peak, LT is the Live Time of the ED channel in relative units, r peak the count rate at the peak position, r bkg is the count rate at the background position and t ED is the measurement time of the ED channel. carrying out energy dispersive XRF, ED-XRF, to measure the concentration of a selected first subset of the elements; carrying out wavelength dispersive XRF, WD-XRF, to measure the concentration of a selected second subset of the elements; wherein the elements are divided between the first and second subsets, taking into account the expected concentrations of the elements, according to a criterion to deliver a reduced overall measurement time to measure all the plurality of elements to a given precision and/or accuracy compared to using only one of the energy dispersive XRF and the wavelength dispersive XRF; wherein in the case that the peak of an element of the elements is higher than the background, the criterion for ED-XRF to be used instead of WD-XRF is given by: E ED E WD ≤ t ED t WD where E is the reciprocal of the sensitivity, E ED is the reciprocal sensitivity for ED-XRF, E WD is the reciprocal sensitivity for WD-XRF, t ED is the measurement time for the ED-XRF measurements to measure the element to the given precision and/or accuracy and t WD is the measurement time for the WD-XRF measurement to measure the element to the given precision and/or accuracy; and in the case that the peak of an element of the elements is not higher than the background the criterion is that ED-XRF is used instead of WD-XRF for elements for which: E WD r peak t peak + l bkg 1 2 r bkg 1 t bkg 1 + l bkg 2 2 r bkg 2 t bkg 2 +... ≥ E ED 1 LT ⋅ r peak t ED + r bkg t ED where r peak is the count rate at the peak position, t peak is the measurement time of the peak, r bkg1 is the count rate at a 1 st background position, t bkg1 is the corresponding measurement time, l bkg1 is the corresponding background factor, with the same for other background positions 2, 3.., wherein the background factor, l bkg1, is equal to 1 or the sum of the background factors, l bkg1, l bkg2..., is equal to 1, wherein the background factors are inversely proportional to the distance to the peak, LT is the Live Time of the ED channel in relative units, r peak the count rate at the peak position, r bkg is the count rate at the background position and t ED is the measurement time of the ED channel.