  The "Cluster HEritage project with \xmm: Mass Assembly and Thermodynamics at
the Endpoint of structure formation" (CHEX-MATE) is a multi-year Heritage
program, to obtain homogeneous XMM-Newton observations of a representative
sample of 118 galaxy clusters. The observations are tuned to reconstruct the
distribution of the main thermodynamic quantities of the ICM up to $R_{500}$
and to obtain individual mass measurements, via the hydrostatic-equilibrium
equation, with a precision of 15-20%. Temperature profiles are a necessary
ingredient for the scientific goals of the project and it is thus crucial to
derive the best possible temperature measurements from our data. This is why we
have built a new pipeline for spectral extraction and analysis of XMM-Newton
data, based on a new physically motivated background model and on a Bayesian
approach with Markov Chain Monte Carlo (MCMC) methods, that we present in this
paper for the first time. We applied this new method to a subset of 30 galaxy
clusters representative of the CHEX-MATE sample and show that we can obtain
reliable temperature measurements up to regions where the source intensity is
as low as 20% of the background, keeping systematic errors below 10%. We
compare the median profile of our sample and the best fit slope at large radii
with literature results and we find a good agreement with other measurements
based on XMM-Newton data. Conversely, when we exclude from our analysis the
most contaminated regions, where the source intensity is below 20 of the
background, we find significantly flatter profiles, in agreement with
predictions from numerical simulations and independent measurements with a
combination of Sunyaev-Zeldovich and X-ray imaging data.
