assertNotNull(obj);
java.math.BigDecimal fixedValue = new java.math.BigDecimal("12345.67");
obj.setValue(fixedValue);
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
XMLEventWriter evtWriter = null;
try {
evtWriter = outputFactory.createXMLEventWriter(outStream);
} catch (XMLStreamException ex) {
}
assertNotNull(evtWriter);
try {
XMLEventFactory factory = XMLEventFactory.newInstance();
staxObject.writeObjectToStax(obj, evtWriter, factory);
evtWriter.flush();
} catch (XMLStreamException ex) {
}
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) {
}