Elemental analysis by X-ray fluorescence spectrometry (XRF) of solid samples from a biorefinery process was performed to study the behaviour of mineral elements in a process involving hydrothermal pretreatment of biomass (wheat straw, corn stover, sugarcane bagasse, palm oil empty fruit bunches, poplar) followed by enzymatic hydrolysis and fermentation. For all the different biomasses, the biorefinery process concentrated silicon, aluminium, and calcium in the solid fraction, while potassium and magnesium were solubilised in the process and removed from the solid fraction. Sodium concentrations were in general low and they only increased in case of addition during the process. No general tendencies were observed for phosphorus, sulphur, and iron concentrations. A prerequisite for XRF elemental analysis was defining an average chemical formula for the organic matrix of process biomass samples. Based on ultimate elemental analysis of all biomasses, the formula for biomass was C6H8.4O3.5, which was used for all types of samples (raw biomass, pretreated biomass, and lignin residue) and can be used in future XRF analysis of samples of similar process and biomass feedstock as those used in this study.