private TreeItem findItemByChain( ArrayList<Element> chain, int idx, TreeItem item )
  {
    if ( idx == chain.size() )
    {
      return item;
    }

    Element hCurElem = chain.get( idx );
    for ( int i = 0, n = item.getChildCount(); i < n; ++i )
    {
      TreeItem child = item.getChild( i );
      if ( child.getElement() == hCurElem )
      {
        TreeItem retItem = findItemByChain( chain, idx + 1, item.getChild( i ) );
        if ( retItem == null )
        {
          return child;
        }
        return retItem;
      }
    }

    return findItemByChain( chain, idx + 1, item );
  }