Java tutorial
//package com.java2s; //License from project: Open Source License import java.io.StringReader; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; public class Main { public static XMLStreamReader buildXmlStreamReader(String xml) throws XMLStreamException { XMLInputFactory factory = XMLInputFactory.newInstance(); return factory.createXMLStreamReader(new StringReader(xml)); } }