String xml = generator.getFileContent(type); assertXMLEqual("Comparing: " + type, writer.getBuffer().toString(), xml);
String actualXml = generator.getFileContent(type); String expectedXml = writer.getBuffer().toString();   actualXml = removeTroublesomeWhitespace(actualXml); expectedXml = removeTroublesomeWhitespace(expectedXml);  assertXMLEqual("Comparing: " + type, expectedXml, actualXml);
    private void checkConfigFileGeneration(ConfigGenerator generator, XmlFile configFile,            ConfigFileType type) throws Exception {        Document document = configFile.getDocument();        StringWriter writer = new StringWriter();        document.write(writer);        String xml = generator.getFileContent(type);        assertXMLEqual("Comparing: " + type, writer.getBuffer().toString(), xml);    }