Thursday, September 25, 2008

Parsing xml string to dom4j Document

This is how to parse xml message to dom4j Document object

public static Document parseXml(String xmlRequest) throws DocumentException {
Reader source = new StringReader(xmlRequest);
SAXReader reader = new SAXReader();
return reader.read(source);
}

No comments: