//denotes an XMLFragment, it is justifiable to keep the current event
//at the Start-element rather than the start document
//What it boils down to is that we need to wrap the reader in a
//stream wrapper to get a fake start-document event
StreamingOMSerializer ser = new StreamingOMSerializer();
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
XMLStreamWriter writer = StAXUtils.createXMLStreamWriter(byteArrayOutputStream);
ser.serialize(
new StreamWrapper(reader),
writer);
writer.flush();
return byteArrayOutputStream.toString();
}