  The third version of the XMM-Newton serendipitous catalogue (3XMM),
containing almost half million sources, is now the largest X-ray catalogue.
However, its full scientific potential remains untapped due to the lack of
distance information (i.e. redshifts) for the majority of its sources. Here we
present XMMPZCAT, a catalogue of photometric redshifts (photo-z) for 3XMM
sources. We searched for optical counterparts of 3XMM-DR6 sources outside the
Galactic plane in the SDSS and Pan-STARRS surveys, with the addition of near-
(NIR) and mid-infrared (MIR) data whenever possible (2MASS, UKIDSS, VISTA-VHS,
and AllWISE). We used this photometry data set in combination with a training
sample of 5157 X-ray selected sources and the MLZ-TPZ package, a supervised
machine learning algorithm based on decision trees and random forests for the
calculation of photo-z. We have estimated photo-z for 100,178 X-ray sources,
about 50% of the total number of 3XMM sources (205,380) in the XMM-Newton
fields selected to build this catalogue (4208 out of 9159). The accuracy of our
results highly depends on the available photometric data, with a rate of
outliers ranging from 4% for sources with data in the optical+NIR+MIR, up to
$\sim$40% for sources with only optical data. We also addressed the reliability
level of our results by studying the shape of the photo-z probability density
distributions.
