Context. We present an XMM-Newton analysis of the X-ray spectra of 39 clusters of galaxies at 0.4 < z < 1.4, covering a temperature range of 1.5 < ∼ kT < ∼ 11 keV. Aims. The main goal of this paper is to study how the abundance evolves with redshift not only by means of a single emission measurement performed on the whole cluster but also by spatially resolving the cluster emission. Methods. We performed a spatially resolved spectral analysis, using Cash statistics and modeling the XMM-Newton background instead of subtracting it, by analyzing the contribution of the core emission to the observed metallicity. Results. We do not observe a statistically significant (>2σ) abundance evolution with redshift. The most significant deviation from no evolution (at a 90% confidence level) is observed by considering the emission from the whole cluster (r < 0.6r 500 ), which can be parametrized as Z ∝ (1 + z) −0.8±0.5 . Dividing the emission into three radial bins, no significant evidence of abundance evolution is observed when fitting the data with a power law. We find close agreement with measurements presented in previous studies. Computing the error-weighted mean of the spatially resolved abundances into three redshift bins, we find that it is consistent with being constant with redshift. Although the large error bars in the measurement of the weighted-mean abundance prevent us from claiming any statistically significant spatially resolved evolution, the trend with z in the 0.15-0.4r 500 radial bin complements nicely previous measurements and broadly agrees with theoretical predictions. We also find that the data points derived from the spatially resolved analysis are well-fitted by the relation Z(r, z) = Z 0 (1+ (r/0.15r 500 ) 2 ) −a ((1+ z)/1.6) −γ , where Z 0 = 0.36± 0.03, a = 0.32± 0.07, and γ = 0.25 ± 0.57, which represents a significant negative trend of Z with radius and no significant evolution with redshift. Conclusions. We present the first attempt to determine the evolution of abundance at different positions in the clusters and with redshift. However, the sample size and the low-quality data statistics associated with most of the clusters studied prevents us from drawing any statistically significant conclusion about the different evolutionary path that the different regions of the clusters may have traversed.