docs: public static boolean copyTreeToResult(Node tree, Result result)
      {
          try {
              // Use a Transformer for output
              TransformerFactory tFactory = TransformerFactory.newInstance();
              Transformer transformer = tFactory.newTransformer();
  
              DOMSource source = new DOMSource(tree);
              transformer.transform(source, result);
              return true;    // Success
          } catch (TransformerConfigurationException tce) {
              // Error generated by the parser
              tce.printStackTrace();
          } catch (TransformerException te) {
              // Error generated by the parser
              te.printStackTrace();
          }
          return false;   // Failure
      }