  The XMM-Large Scale Structure survey, covering an area of 11.1 sq. deg.,
contains more than 6000 X-ray point-like sources detected with XMM-Newton down
to a flux of 3x10^-15 erg s^-1 cm^-2 in the [0.5-2] keV band, the vast majority
of which have optical (CFHTLS), infrared (SWIRE), near-infrared (UKIDSS) and/or
ultraviolet (GALEX) counterparts. We wish to investigate the environmental
properties of the different types of the XMM-LSS X-ray sources, defining their
environment using the i-band CFHTLS W1 catalog of optical galaxies down to a
magnitude limit of 23.5 mag. We have classified 4435 X-ray selected sources on
the basis of their spectra, SEDs and X-ray luminosity and estimated their
photometric redshifts, having 4-11 band photometry, with an accuracy
sigma=0.076 and 22.6% outliers for i<26 mag. We estimated the local
overdensities of 777 X-ray sources which have spectro-z or photo-z calculated
using more than 7 bands (accuracy sigma=0.061 with 13.8% outliers) within the
volume-limited region defined by 0.1<z<0.85 and -23.5<Mi<-20. Although X-ray
sources may be found in variety of environments, a large fraction (~55-60%), as
verified by comparing with the random expectations, reside in overdense
regions. The galaxy overdensities within which X-ray sources reside show a
positive recent redshift evolution. We also find that X-ray selected galaxies,
with respect to AGN, inhabit significantly higher galaxy overdensities,
although their spatial extent appear to be smaller than that of AGN. Hard AGN
(HR>=-0.2) are located in more overdense regions with respect to the Soft AGN
(HR<-0.2), a fact clearly seen in both redshift ranges, although it appears to
be stronger in the higher redshift range (0.55<z<0.85). Furthermore, the galaxy
overdensities (with d>1.5) within which Soft AGN are embedded appear to evolve
more rapidly with respect to the corresponding overdensities around Hard AGN.
