private static String transform(Transformer transformer, Node element)
      throws TransformerException {
    StreamResult result = new StreamResult(new StringWriter());
    DOMSource source = new DOMSource(element);
    transformer.transform(source, result);

    return result.getWriter().toString();
  }
*
Converts the document to a well formatted Xml string

@return pretty xml string
geode-core/src/main/java/org/apache/geode/management/internal/configuration/utils/XmlUtils.java