builder.debugDiscarded(container);
}
throw new NodeUnavailableException();
}
if (cache) {
INode child = (INode)container.getFirstOMChild();
while (child != null) {
child.internalSerialize(this, format, true);
child = (INode)child.getNextOMSibling();
}
} else {
// First, recursively serialize all child nodes that have already been created
INode child = (INode)container.getFirstOMChildIfAvailable();
while (child != null) {
child.internalSerialize(this, format, cache);
child = (INode)child.getNextOMSiblingIfAvailable();
}
// 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) {