throws IOException, XMLStreamException
{
// Let's ensure it's a new factory, to minimize caching probs
XMLInputFactory2 f = getNewInputFactory();
if (enc == null) { // reader-based
return (XMLStreamReader2) f.createXMLStreamReader(new StringReader(content));
}
// nope, byte based
byte[] data = content.getBytes(enc);
return (XMLStreamReader2) f.createXMLStreamReader(new ByteArrayInputStream(data));
}