public static String prettyXml(Node doc)
      throws TransformerFactoryConfigurationError, TransformerException {
    Transformer transformer = TransformerFactory.newInstance().newTransformer();
    transformer.setOutputProperty(OutputKeys.INDENT, "yes");

    return transform(transformer, doc);
  }
*
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