long firstChildId = XMLUtil.getFirstChildId(doc, id); Iterator iter = new DOMFileIterator(lock, doc, this, parentPointer); Value value = (Value) iter.next(); NodeImpl n = NodeImpl.deserialize(value.getData(), doc);
final long firstChildId = XMLUtil.getFirstChildId(doc, id); final Iterator iter = new DOMFileIterator(lock, doc, this, parentPointer); final Value value = (Value) iter.next(); final NodeImpl n = NodeImpl.deserialize(value.getData(), doc);
	private long findValue(Object lock, NodeProxy node)		throws IOException, BTreeException {		DocumentImpl doc = (DocumentImpl) node.getDoc();		NativeBroker.NodeRef nodeRef =			new NativeBroker.NodeRef(doc.getDocId(), node.getGID());		try {			// first try to find the node in the index			return findValue(nodeRef);		} catch (BTreeException e) {			// node not found in index: try to find the nearest available			// ancestor and traverse it			long id = node.getGID();			long parentPointer = -1;			while (parentPointer < 0) {				if (id < 1)					throw new BTreeException(						"node " + node.gid + " not found.");				id = XMLUtil.getParentId(doc, id);				NativeBroker.NodeRef parentRef =					new NativeBroker.NodeRef(doc.getDocId(), id);				try {					parentPointer = findValue(parentRef);				} catch (BTreeException bte) {				}			}			long firstChildId = XMLUtil.getFirstChildId(doc, id);			Iterator iter = new DOMFileIterator(lock, doc, this, parentPointer);			Value value = (Value) iter.next();			NodeImpl n = NodeImpl.deserialize(value.getData(), doc);			n.setGID(id);			long address = findNode(n, node.gid, iter);			return address == 0 ? -1 : address;		}	}