The latest results of the XXL survey - the largest observation program in X-ray produced to date by the XMM satellite - have recently been published in a special issue of the journal Astronomy & Astrophysics. This second batch of data includes information on 365 galaxy clusters and 26,000 active galactic nuclei (AGN). By deep examination of two major regions of the sky, the XXL survey is the first X-ray study to detect enough clusters of galaxies and AGN to trace the large-scale structure of the Universe and its evolution in time with unprecedented details. We shall discuss the results of the cosmological analysis and present a new and original method to conduct X-ray cluster cosmology.