code: private CmsSitemapEntryBean convertNavigationTreeToBean(CmsObject cms, NavigationNode node, boolean isRoot) {
  
          CmsSitemapEntryBean bean = null;
          try {
              bean = prepareSitemapEntry(cms, node.getNavElement(), isRoot, false);
              bean.setSearchMatch(node.isMatch());
              List<NavigationNode> children = node.getChildren();
              List<CmsSitemapEntryBean> childBeans = Lists.newArrayList();
              if (children.size() > 0) {
                  for (NavigationNode child : children) {
                      childBeans.add(convertNavigationTreeToBean(cms, child, false));
                  }
              } else if (node.isLeaf()) {
                  childBeans = Lists.newArrayList();
              } else {
                  // no children in filter result, but can still load children by clicking on tree item
                  childBeans = null;
              }
              bean.setChildren(childBeans);
  
          } catch (CmsException e) {
              LOG.error(e.getLocalizedMessage(), e);
          }
          return bean;
      }
docs: Helper method to construct a sitemap entry bean for the sitemap tab filter functionality.<p>
  
  @param cms the CMS context
  @param node the root node of the filtered tree
  @param isRoot true if this is the root node
  
  @return the sitemap entry bean