code: public static TreeElement findSelected(TreeElement root)
      {
          assert (root != null) : "parameter 'root' must not be null";
          if (root instanceof ITreeRootElement) {
              return ((ITreeRootElement) root).getSelectedNode();
          }
          return recursiveFindSelected(root);
      }
docs: This will return the currently selected node from a tree.
  
  <p>Implementation Note: The method that changes the selected node based on the request,
  {@link #processTreeRequest(String, TreeElement, HttpServletRequest, HttpServletResponse)},
  gets called during the processing of the {@link Tree} tag within a JSP. If the
  <code>findSelected</code> method is called from an Action in a Page Flow Controller,
  the value of the selected node will have not yet been updated.</p>
  
  @param root the root element of the tree.
  @return a TreeElement that is the currently selected node.  This may return null.