code: private synchronized Document asXmlDocument() throws IOException {
      Document doc;
      try {
        doc =
          DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
      } catch (ParserConfigurationException pe) {
        throw new IOException(pe);
      }
      Element conf = doc.createElement("configuration");
      doc.appendChild(conf);
      conf.appendChild(doc.createTextNode("\n"));
      handleDeprecation(); //ensure properties is set and deprecation is handled
      for (Enumeration<Object> e = properties.keys(); e.hasMoreElements();) {
        String name = (String)e.nextElement();
        Object object = properties.get(name);
        String value = null;
        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);
  
        if (updatingResource != null) {
          String[] sources = updatingResource.get(name);
          if(sources != null) {
            for(String s : sources) {
              Element sourceNode = doc.createElement("source");
              sourceNode.appendChild(doc.createTextNode(s));
              propNode.appendChild(sourceNode);
            }
          }
        }
  
        conf.appendChild(doc.createTextNode("\n"));
      }
      return doc;
    }
docs: Return the XML DOM corresponding to this Configuration.