System.err.println(top + " = " + proxy.gid); storedNodes.put(top, proxy); top = getNextSiblingFor(top);
int old = ((Integer)oldIds.get(i)).intValue(); storedNodes.put(old, proxy); top = expandedDoc.getNextSiblingFor(top);
    protected void makePersistent() throws XPathException {    	expand();    	org.exist.dom.DocumentImpl doc = context.storeTemporaryDoc(this);    	NodeList cl = doc.getDocumentElement().getChildNodes();    	storedNodes = new Int2ObjectHashMap();    	int top = size > 1 ? 1 : -1;    	int i = 0;        while(top > 0 && i < cl.getLength()) {            org.exist.dom.NodeImpl node = (org.exist.dom.NodeImpl) cl.item(i);            NodeProxy proxy = new NodeProxy(doc, node.getGID(), node.getInternalAddress());            System.err.println(top + " = " + proxy.gid);            storedNodes.put(top, proxy);            top = getNextSiblingFor(top);            i++;        }    }