code: 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;
      }
docs: 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