public static Document parseXml(String xml) throws ParserConfigurationException, SAXException, IOException {
        Document doc = null;
        try {
            DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            doc = documentBuilder.parse(new ByteArrayInputStream(xml.getBytes("utf-8")));
            doc.getDocumentElement().normalize();            
        } catch (Exception e) {
        }

        return doc;
    }