} else
{context.checkOptions(serializeOptions);}
context.pushDocumentContext();
try {
final InMemoryNodeSet result = new InMemoryNodeSet();
final MemTreeBuilder builder = context.getDocumentBuilder();
final DocumentBuilderReceiver receiver = new DocumentBuilderReceiver(builder, true);
for (final SequenceIterator i = args[0].iterate(); i.hasNext(); ) {
final int nodeNr = builder.getDocument().getLastNode();
final NodeValue next = (NodeValue) i.nextItem();
next.toSAX(context.getBroker(), receiver, serializeOptions);
result.add(builder.getDocument().getNode(nodeNr + 1));
}
return result;
} catch (final SAXException e) {
throw new XPathException(this, e);
} finally {