TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
StringWriter xmlout = new StringWriter();
StreamResult result = new StreamResult(xmlout);
transformer.transform(new DOMSource(doc.getFirstChild()), result);
ManagedConnectionPoolStatistics rawStatistics = (ManagedConnectionPoolStatistics)getServer().invoke(POOL_NAME, RAW_STATS_METHOD, new Object[0], new String[0]);
JBossXmlSubPoolStatisticFormatter xmlFormatter = new JBossXmlSubPoolStatisticFormatter();
String xml2 = (String)xmlFormatter.formatSubPoolStatistics(rawStatistics);
Document doc2 = builder.parse(new InputSource(new StringReader(xml2)));
StringWriter xmlout2 = new StringWriter();
StreamResult result2 = new StreamResult(xmlout2);
transformer.transform(new DOMSource(doc2.getFirstChild()), result2);
//only compare xml content, ignore standalone="no"
assertEquals(xmlout.toString(), xmlout2.toString());