code: public void writeXml(OutputStream out) throws IOException {
          Properties properties = getProps();
          try {
              Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
              Element conf = doc.createElement("configuration");
              doc.appendChild(conf);
              conf.appendChild(doc.createTextNode("\n"));
              for (Enumeration e = properties.keys(); e.hasMoreElements();) {
                  String name = (String) e.nextElement();
                  Object object = properties.get(name);
                  String value;
                  if (object instanceof String) {
                      value = (String) object;
                  } else {
                      continue;
                  }
                  Element propNode = doc.createElement("property");
                  conf.appendChild(propNode);
  
                  Element nameNode = doc.createElement("name");
                  nameNode.appendChild(doc.createTextNode(name));
                  propNode.appendChild(nameNode);
  
                  Element valueNode = doc.createElement("value");
                  valueNode.appendChild(doc.createTextNode(value));
                  propNode.appendChild(valueNode);
  
                  conf.appendChild(doc.createTextNode("\n"));
              }
  
              DOMSource source = new DOMSource(doc);
              StreamResult result = new StreamResult(out);
              TransformerFactory transFactory = TransformerFactory.newInstance();
              Transformer transformer = transFactory.newTransformer();
              transformer.transform(source, result);
          } catch (Exception e) {
              throw new RuntimeException(e);
          }
      }
docs: Write out the non-default properties in this configuration to the give
  {@link OutputStream}.
  
  @param out the output stream to write to.