Java tutorial
//package com.java2s; import java.io.IOException; import java.io.Reader; import java.io.StringReader; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; public class Main { private static final XMLInputFactory xiFactory = XMLInputFactory.newInstance(); public static XMLStreamReader stringToStream(String content) throws IOException { //get Reader connected to XML input from somewhere..? Reader reader = new StringReader(content); try { return xiFactory.createXMLStreamReader(reader); } catch (XMLStreamException ex) { throw new IOException(ex); } } }