} finally { context.popDocumentContext();
	protected Sequence deepCopy(Sequence inSeq) throws XPathException {		context.pushDocumentContext();		MemTreeBuilder builder = context.getDocumentBuilder();		DocumentBuilderReceiver receiver = new DocumentBuilderReceiver(builder);		Serializer serializer = context.getBroker().getSerializer();		serializer.setReceiver(receiver);				try {			Sequence out = new ValueSequence();			for (SequenceIterator i = inSeq.iterate(); i.hasNext(); ) {				Item item = i.nextItem();				if (Type.subTypeOf(item.getType(), Type.NODE)) {					if (((NodeValue)item).getImplementationType() == NodeValue.PERSISTENT_NODE) {						int last = builder.getDocument().getLastNode();						NodeProxy p = (NodeProxy) item;						serializer.toReceiver(p);						item = builder.getDocument().getNode(last + 1);					} else {						((org.exist.memtree.NodeImpl)item).expand();//                        System.out.println(context.getBroker().getSerializer().serialize((NodeValue)item));					}				}				out.add(item);			}			return out;		} catch(SAXException e) {			throw new XPathException(getASTNode(), e.getMessage(), e);		}	}