\lstset{
basicstyle=\ttfamily,
columns=fullflexible,
showstringspaces=false,
commentstyle=\color{gray}\upshape
}
\lstdefinelanguage{XML}
{
morecomment=[s]{<?}{?>},
morecomment=[s]{<!--}{-->},
morestring=[b]",
morestring=[s]{>}{<},
commentstyle=\color{gray},
stringstyle=\color{black},
identifierstyle=\color{darkblue},
keywordstyle=\color{cyan},
morekeywords={xmlns,version,type},% list your attributes here
}