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);