Hi, I wrote a simple XML writer (cmXMLWriter) that takes care of indentation, escaping, and balancing of end tags. I also ported all of CTest's XML generation to cmXMLWriter. https://github.com/purpleKarrot/CMake/commits/xmlwriter Please review and potentially apply. cheers, Daniel