public static OrganigramNode findTreeNode(OrganigramNode searchRoot, OrganigramNode selection) {
        if (selection == null || searchRoot == null) {
            return null;
        }

        if (searchRoot.equals(selection)) {
            return searchRoot;
        }

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

        return null;
    }
Finds a {@link OrganigramNode} for the given selection.

@param searchRoot The {@link OrganigramNode} to start the search.
@param selection  The selection.
@return The {@link OrganigramNode} for the selection or <code>null</code>.
primefaces/src/main/java/org/primefaces/component/organigram/OrganigramHelper.java