code: private String toXml(Node node) {
          try {
              Transformer transformer = TransformerFactory.newInstance().newTransformer();
              StreamResult result = new StreamResult(new StringWriter());
              DOMSource source = new DOMSource(node);
              transformer.transform(source, result);
              return result.getWriter().toString();
            } catch(TransformerException ex) {
                throw new IllegalArgumentException("Could not transform "  +node + " to XML", ex);
            }
      }
docs: Returns the XML node as String of XML.
  
  @param node Node to convert to String of XML
  
  @return the XML node as String of XML.