final XMLOutputFactory factory = XMLOutputFactory.newInstance();
XMLStreamWriter serializer;
final XMLStreamHelper xmlStreamHelper = SDOUtil.createXMLStreamHelper(scope);
try {
serializer = factory.createXMLStreamWriter(baos);
xmlStreamHelper.saveObject(dataObject, serializer);
serializer.flush();
}
catch (final XMLStreamException e) {
fail("Exception encountered during XMLStreamHelper serialization.");
e.printStackTrace();