  Our goal is to probe the populations of obscured and unobscured AGN
investigating their optical-IR and X-ray properties as a function of X-ray
flux, luminosity and redshift within a hard X-ray selected sample of 136 X-ray
sources in the XMM Medium Deep Survey (XMDS) with wide multiwavelength
coverage. The XMDS area is covered with optical photometry from the VVDS and
CFHTLS surveys and infrared Spitzer data. Based on the X-ray luminosity and
X-ray to optical ratio, 132 sources are likely AGN, of which 122 have
unambiguous optical - IR identification. The observed optical and IR spectral
energy distributions of sources are fitted with AGN/galaxy templates in order
to classify them and compute photometric redshifts. 70% of the AGN are fitted
by a type 2 AGN or a star forming galaxy template and are grouped together in a
single class of ``optically obscured'' AGN. They have ``red'' optical colors
and generally show significant X-ray absorption from X-ray spectra or hardness
ratios (N$_H > 10^{22}$ cm$^{-2}$). Sources with SEDs typical of type 1 AGN
have ``blue'' optical colors and exhibit X-ray absorption in about 30% of
cases. We performed a stacking analysis for obscured and type 1 AGN. The
stacked X-ray spectrum of obscured AGN is flatter than that of type 1 AGN and
has an average spectral slope of Gamma = 1.6. The subsample of objects fitted
by a galaxy template has an even harder stacked spectrum, with Gamma = 1.2 -
1.3. The obscured fraction is larger at lower fluxes, lower redshifts and lower
luminosities. X-ray absorption is less common than ``optical'' obscuration and
its incidence is nearly constant with redshift and luminosity. This implies
that X-ray absorption is not necessarily related to optical obscuration.
