  A well characterised detection pipeline is an important ingredient for X-ray
cluster surveys. We present the final development of the XXL Survey pipeline.
The pipeline optimally uses X-ray information by combining many overlapping
observations of a source when possible, both for its detection and its
characterisation. It can robustly detect and characterise several types of
X-ray sources: AGNs (point-like), galaxy clusters (extended), galaxy clusters
contaminated by a central AGN, and pairs of AGNs close on the sky. We perform a
thorough suite of validation tests via realistic simulations of XMM-Newton
images and we introduce new selection criteria for various types of sources
that will be detected by the survey. We find that the use of overlapping
observations allows new clusters to be securely identified that would be missed
or less securely identified by using only one observation at the time. We also
find that with the new pipeline we can robustly identify clusters with a
central AGN that would otherwise have been missed, and we can flag pairs of
AGNs close on the sky that might have been mistaken for a cluster.
