code: public static Document toDocument(String xml) throws SAXException {
  		try {
  			return toDocument(new StringReader(xml));
  		} catch (IOException e) {
  			//reading from string
  			throw new RuntimeException(e);
  		}
  	}
docs: Parses an XML string into a DOM.
  @param xml the XML string
  @return the parsed DOM
  @throws SAXException if the string is not valid XML