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