docs: public static void storeXML(Map pProperties, OutputStream pOutput, String pHeader) throws IOException {
      // Build XML tree (Document) and write
      // Find the implementation
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      factory.setNamespaceAware(true);
      DocumentBuilder builder;
      try {
        builder = factory.newDocumentBuilder();
      }
      catch (ParserConfigurationException e) {
        throw (IOException) new IOException(e.getMessage()).initCause(e);
      }
      DOMImplementation dom = builder.getDOMImplementation();
  
      Document document = dom.createDocument(null, PROPERTIES, dom.createDocumentType(PROPERTIES, null, SYSTEM_DTD_URI));
      Element root = document.getDocumentElement();
  
      // This is probably not the correct way of setting a default namespace
      root.setAttribute(XMLNS, NAMESPACE_URI);
  
      // Create and insert the normal Properties headers as XML comments
      if (pHeader != null) {
        document.insertBefore(document.createComment(" " + pHeader + " "), root);
      }
      document.insertBefore(document.createComment(" " + new Date() + " "), root);
  
      // Insert elements from the Properties
      Iterator iterator = pProperties.entrySet().iterator();
  
      while (iterator.hasNext()) {
        Map.Entry entry = (Map.Entry) iterator.next();
        String key = (String) entry.getKey();
        Object value = entry.getValue();
        String format = null;
  
        if (pProperties instanceof XMLProperties) {
          format = ((XMLProperties) pProperties).getPropertyFormat(key);
        }
        insertElement(document, key, value, format);
      }
  
      // Create serializer and output document
      //XMLSerializer serializer = new XMLSerializer(pOutput, new OutputFormat(document, UTF_8_ENCODING, true));
      XMLSerializer serializer = new XMLSerializer(pOutput, UTF_8_ENCODING);
  
      serializer.serialize(document);
    }