ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
XMLEventReader evtReader = null;
try {
evtReader = inputFactory.createXMLEventReader(inStream);
// read the first tag which should be a start document
XMLEvent evt = evtReader.nextEvent();
assertTrue(evt.isStartDocument());
} catch (XMLStreamException ex) {
}
assertNotNull(evtReader);