docs: public static void convertDOMToXML(Node doc, Writer out)
      {
          try {
              // Use a Transformer for output
              TransformerFactory tFactory = TransformerFactory.newInstance();
              Transformer transformer = tFactory.newTransformer();
  
              DOMSource source = new DOMSource(doc);
  
              StreamResult result = new StreamResult(out);
              transformer.transform(source, result);
          } catch (TransformerConfigurationException tce) {
              // Error generated by the parser
              tce.printStackTrace();
          } catch (TransformerException te) {
              // Error generated by the parser
              te.printStackTrace();
          }
      }