code: private synchronized Document asXmlDocument(String propertyName)
  			throws IOException, IllegalArgumentException {
  		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
  
  		if(!Strings.isNullOrEmpty(propertyName)) {
  			if (!properties.containsKey(propertyName)) {
  				// given property not found, illegal argument
  				throw new IllegalArgumentException("Property " +
  						propertyName + " not found");
  			} else {
  				// given property is found, write single property
  				appendXMLProperty(doc, conf, propertyName);
  				conf.appendChild(doc.createTextNode("\n"));
  			}
  		} else {
  			// append all elements
  			for (Enumeration<Object> e = properties.keys(); e.hasMoreElements();) {
  				appendXMLProperty(doc, conf, (String)e.nextElement());
  				conf.appendChild(doc.createTextNode("\n"));
  			}
  		}
  		return doc;
  	}
docs: Return the XML DOM corresponding to this Configuration.