@org.junit.Test
public void testReader() throws Exception {
XMLInputFactory factory = XMLInputFactory.newInstance();
XMLStreamReader r1 = factory.createXMLStreamReader(new StringReader(xml));
XMLDocumentStreamReader r2 = new XMLDocumentStreamReader(r1);
XMLStreamReader2String t1 = new XMLStreamReader2String();
String result = t1.transform(r2, null);
System.out.println(result);
XMLStreamReader r3 = factory.createXMLStreamReader(new StringReader(xml));
r3.nextTag();
r3.nextTag();
Assert.assertEquals(XMLStreamConstants.START_ELEMENT, r3.getEventType());
Assert.assertEquals(new QName(null, "e2"), r3.getName());
XMLDocumentStreamReader r4 = new XMLDocumentStreamReader(r3);
result = t1.transform(r4, null);
System.out.println(result);
}