private void streamXML(final Document doc, final OutputStream out) {
    try {// Use a Transformer for output
      final TransformerFactory tFactory = TransformerFactory.newInstance();
      final Transformer transformer = tFactory.newTransformer();
      if (doc.getDoctype() != null) {
        final String systemId = doc.getDoctype().getSystemId();
        final String publicId = doc.getDoctype().getPublicId();
        transformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, publicId);
        transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, systemId);
      }
      transformer.setOutputProperty(OutputKeys.INDENT, "yes");
      transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
      final DOMSource source = new DOMSource(doc);
      final StreamResult result = new StreamResult(out);
      transformer.transform(source, result);
    } catch (final Exception e) {
      e.printStackTrace();
    }
  }
The main entry point for processing

@throws Exception if any errors occur.
extensions/geode-modules-session/src/main/java/org/apache/geode/modules/session/installer/Installer.java