Basic implementation of recursive node search by id It works only on a
DefaultNodeImpl

@param rootNode
@param nodeId
@return Node instance or null if there is no node with specific id
320731
public static Node searchNodeById(Node rootNode, int nodeId) {
        if (rootNode.getNodeId() == nodeId) {
            return rootNode;
        }
        Node foundNode = null;
        for (Node n : rootNode.getChilds()) {
            foundNode = searchNodeById(n, nodeId);
            if (foundNode != null) {
                break;
            }
        }
        return foundNode;
    }
854753
private AbstractNode findNodeByUuid(final SecurityContext securityContext, final String uuid) throws FrameworkException {

		if (!uuid.isEmpty()) {

			logger.debug("Requested id: {}", uuid);

			return (AbstractNode) StructrApp.getInstance(securityContext).getNodeById(uuid);
		}

		return null;
	}
231761
Node getNode(Node root) {
        if (isRoot()) {
            return root;
        }

        Node startNode = root;
        Matcher pathMatcher = dotWithPreviousChar.matcher(path);
        int pos = 0;
        while (pathMatcher.find()) {
            String step = path.substring(pos, pathMatcher.end() - 1);
            pos = pathMatcher.end();
            startNode = doStep(step, startNode);
        }
        startNode = doStep(path.substring(pos), startNode);
        return startNode;
    }
398124
public void retainNode(String id) {
        synchronized (retainedNodes) {
            Node current = getCurrentNode();

            if (current != null) {
                retainedNodes.put(id, current);
            }
        }
    }
1090337
function findNode(name, root) {
        var i, stack, node;
        if (root === null || root === undefined) { return null; }
        stack = [root];
        while (stack.length > 0) {
            node = stack.pop();
            if (node.name === name) {
                return node;
            }
            for (i = node.children.length - 1; i >= 0; i -= 1) {
                stack.push(node.children[i]);
            }
        }
        return null;
    }
565905
public AbstractNode getNode(final String id) {

		final SecurityContext securityContext = getWebSocket().getSecurityContext();
		final App app = StructrApp.getInstance(securityContext);

		try (final Tx tx = app.tx()) {

			final AbstractNode node = (AbstractNode) app.getNodeById(id);

			tx.success();

			return node;

		} catch (FrameworkException fex) {
			logger.warn("Unable to get node", fex);
		}

		return null;
	}
711234
public function getNode($nodeId)
    {
        static $instance = array();
        if (isset($instance[$nodeId]))
            return $instance[$nodeId];
        $nodes = $this->nodeSet;
        if (empty($nodes))
            return NULL;
        foreach ($nodes as $node):
            if ($node->getId() == $nodeId):
                $instance[$nodeId] = &$node;
                break;
            endif;
        endforeach;
        return NULL;
    }
617342
public RedisClusterNode getPartitionByNodeId(String nodeId) {

        for (RedisClusterNode partition : nodeReadView) {
            if (partition.getNodeId().equals(nodeId)) {
                return partition;
            }
        }

        return null;
    }
127209
public function getNodeById($id, $recursively = false) {
        $found = null;
        if (true === array_key_exists($id, $this->index)) {
            $found = $this->getNodeAt($this->index[$id]);
        }
        if (null === $found && true === $recursively) {
            foreach ($this->nodes as $current) {
                $found = $current->getNodeById($id, $recursively);
                if (null !== $found) {
                    break;
                }
            }
        }
        return $found;
    }
790986
public static Node getChildNode(Node parentNode, String name, String value){
                List<Node> matchingChildren = getChildren(parentNode, name, value);
                return (matchingChildren.size() > 0) ? matchingChildren.get(0) : null;
        }
1017728
public static OrganigramNode findTreeNode(OrganigramNode searchRoot, String rowKey) {

        if (rowKey == null || searchRoot == null) {
            return null;
        }

        if (searchRoot.getRowKey().equals(rowKey)) {
            return searchRoot;
        }

        if (searchRoot.getChildren() != null) {
            for (OrganigramNode child : searchRoot.getChildren()) {
                OrganigramNode childResult = findTreeNode(child, rowKey);
                if (childResult != null) {
                    return childResult;
                }
            }
        }

        return null;
    }
1284354
@SuppressWarnings("unchecked")
	private Node<K, V> getNodeCache(final int nodeid) {
		final boolean isLeaf = Node.isLeaf(nodeid);
		boolean responseFromCache = true;
		Node<K, V> node = (isLeaf ? dirtyLeafNodes : dirtyInternalNodes).get(nodeid);
		if (node == null) {
			node = (isLeaf ? cacheLeafNodes : cacheInternalNodes).get(nodeid);
			if (node == null) {
				if (log.isDebugEnabled())
					log.debug("diskread node id=" + nodeid);
				node = getNodeFromStore(nodeid);
				responseFromCache = false;
				(node.isLeaf() ? cacheLeafNodes : cacheInternalNodes).put(nodeid, node);
			}
		}
		if (enableIOStats) {
			if (responseFromCache) {
				getIOStat(nodeid).incCacheRead();
			}
		}
		return node;
	}
1004800
public static <T extends TreeNode<T>> T getRoot(T node) {
        if (node == null) return null;
        if (node.getParent() != null) return getRoot(node.getParent());
        return node;
    }
49468
public Integer getNodesPartitionIdForKey(int nodeId, final byte[] key) {
        // this is all the partitions the key replicates to.
        List<Integer> partitionIds = getReplicatingPartitionList(key);
        for(Integer partitionId: partitionIds) {
            // check which of the replicating partitions belongs to the node in
            // question
            if(getNodeIdForPartitionId(partitionId) == nodeId) {
                return partitionId;
            }
        }
        return null;
    }
331586
public static IdGenerator getInstance(long nodeId) {
        IdGenerator idGen = cache.get(nodeId);
        if (idGen == null) {
            idGen = new IdGenerator(nodeId);
            idGen.init();
            IdGenerator existing = cache.putIfAbsent(nodeId, idGen);
            idGen = existing != null ? existing : idGen;
        }
        return idGen;
    }
1147493
public static clusternode[] get(nitro_service service, Long nodeid[]) throws Exception{
		if (nodeid !=null && nodeid.length>0) {
			clusternode response[] = new clusternode[nodeid.length];
			clusternode obj[] = new clusternode[nodeid.length];
			for (int i=0;i<nodeid.length;i++) {
				obj[i] = new clusternode();
				obj[i].set_nodeid(nodeid[i]);
				response[i] = (clusternode) obj[i].get_resource(service);
			}
			return response;
		}
		return null;
	}
17149
function (xmlNode, nodeName) {

            var childs = xmlNode.childNodes;

            for (var i = 0; i < childs.length; ++i) {

                var item = childs.item(i);

                if (item.nodeType !== 1) {
                    continue;
                }

                if ((item.nodeName && !nodeName) || (nodeName && nodeName === item.nodeName)) {
                    return item;
                }
            }

            return null;
        }