  Nitrogen is one of the most abundant metals in the interstellar medium (ISM),
and thus it constitutes an excellent test to study a variety of astrophysical
environments, ranging from nova to active galactic nuclei. We present a
detailed analysis of the gaseous component of the N K~edge using
high-resolution {\it XMM-Newton} spectra of 12 Galactic and 40 extragalactic
sources. For each source, we have estimated column densities for {\rm N}~{\sc
i}, {\rm N}~{\sc ii}, {\rm N}~{\sc iii}, {\rm N}~{\sc v}, {\rm N}~{\sc vi} and
{\rm N}~{\sc vii} ionic species, which trace the cold, warm and hot phases of
the local Galactic interstellar medium. We have found that the cold-warm
component column densities decrease with the Galactic latitude while the hot
component does not. Moreover, the cold column density distribution is in good
agreement with UV measurements. This is the first detailed analysis of the
nitrogen K-edge absorption due to ISM using high-resolution X-ray spectra.
