public static void prettyPrintXML(final Reader reader, final Writer writer) {
        try {
            final TransformerHandler handler = createTransformerHandler(new FatalErrorListener(), true);
            handler.setResult(new StreamResult(writer));

            final SAXParser parser = PARSER_FACTORY.newSAXParser();
            final XMLReader xmlReader = parser.getXMLReader();
            xmlReader.setErrorHandler(new FatalErrorHandler());
            xmlReader.setContentHandler(handler);
            xmlReader.parse(new InputSource(reader));

        } catch (final Exception e) {
            throw new RuntimeException(e);
        }
    }
Convert a java type into a xml name E.g. XMLType = "xmlType", String =
"string", StringBIG = "StringBIG"
stroom-legacy/stroom-legacy-model_6_1/src/main/java/stroom/legacy/model_6_1/XMLUtil.java