// Next, if the container is incomplete, disable caching (temporarily)
// and serialize the nodes that have not been built yet by copying the
// events from the underlying XMLStreamReader.
if (!container.isComplete() && container.getBuilder() != null) {
StAXOMBuilder builder = (StAXOMBuilder)container.getBuilder();
XMLStreamReader reader = builder.disableCaching();
DataHandlerReader dataHandlerReader = XMLStreamReaderUtils.getDataHandlerReader(reader);
boolean first = true;
int depth = 0;
loop: while (true) {
int event;