1public static Document loadXMLFromString(String xml) throws Exception
2{
3 DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
4 DocumentBuilder builder = factory.newDocumentBuilder();
5 InputSource is = new InputSource(new StringReader(xml));
6 return builder.parse(is);
7}