I'm doing this in an internal tool for my development team. I format the XML with an xsl that colors and indents everything, then update the web control with the resulting HTML.
Check out this link for formatting XML, the CSS styles are built in, so you can update styles colors as you wish See the "XML to HTML Verbatim Formatter with Syntax Highlighting" project on this page. http://www2.informatik.hu-berlin.de/~obecker/XSLT/