if (spec != null) {
RangeIndexSpec qnIdx = idxSpec.getIndexByQName(node.getQName()); if (spec != null || qnIdx != null) {
    private void removeAll(NodeImpl node, NodePath currentPath) {        switch (node.getNodeType()) {            case Node.ELEMENT_NODE:				String content = null;				IndexSpec idxSpec = 				    ownerDocument.getCollection().getIdxConf(ownerDocument.broker);				if (idxSpec != null) {					GeneralRangeIndexSpec spec = idxSpec.getIndexByPath(currentPath);					if (spec != null) {						NodeProxy p = new NodeProxy(node.ownerDocument, node.gid, node.internalAddress);						content = ownerDocument.broker.getNodeValue(p, false);					}				}                NodeList children = node.getChildNodes();                NodeImpl child;                for (int i = children.getLength() - 1; i > -1; i--) {                    child = (NodeImpl) children.item(i);                    if (child.nodeType == Node.ELEMENT_NODE) {                        currentPath.addComponent(((ElementImpl) child).getQName());                        removeAll(child, currentPath);                        currentPath.removeLastComponent();                    }                    else                        removeAll(child, currentPath);                }                ownerDocument.broker.removeNode(node, currentPath, content);                break;            default :                ownerDocument.broker.removeNode(node, currentPath, null);                break;        }    }