parentID = XMLUtil.getParentId(current.getDocument(), parentID);
    public NodeSet getAncestors(boolean rememberContext, boolean includeSelf) {        NodeSet ancestors = new ExtArrayNodeSet();        for (Iterator i = iterator(); i.hasNext();) {            NodeProxy p = (NodeProxy) i.next();            if (includeSelf) {            	if (rememberContext)            		p.addContextNode(p);                ancestors.add(p);            }            long gid = p.getGID();            // calculate parent's gid            while ((gid = XMLUtil.getParentId(p.getDocument(), gid)) > 0) {                if (gid != NodeProxy.DOCUMENT_NODE_GID &&                         //Remove the temorary nodes wrapper element                         //TODO : optimize this !!!                        !(gid == NodeProxy.DOCUMENT_ELEMENT_GID && p.getDocument().getCollection().isTempCollection())) {                                	NodeProxy parent = ancestors.get(p.getDocument(), gid);                	if (parent == null)                		parent = new NodeProxy(p.getDocument(), gid, Node.ELEMENT_NODE);                    if (rememberContext)                        parent.addContextNode(p);                    else                        parent.copyContext(p);                    ancestors.add(parent);                }            }        }        return ancestors;    }