code: public int getLastPos(XPathContext xctxt)
    {
  
      int count = 0;
      AxesWalker savedWalker = wi().getLastUsedWalker();
  
      try
      {
        ReverseAxesWalker clone = (ReverseAxesWalker) this.clone();
  
        clone.setRoot(this.getRoot());
  
        clone.setPredicateCount(m_predicateIndex);
  
        clone.setPrevWalker(null);
        clone.setNextWalker(null);
        wi().setLastUsedWalker(clone);
  
        // Count 'em all
        // count = 1;
        int next;
  
        while (DTM.NULL != (next = clone.nextNode()))
        {
          count++;
        }
      }
      catch (CloneNotSupportedException cnse)
      {
  
        // can't happen
      }
      finally
      {
        wi().setLastUsedWalker(savedWalker);
      }
  
      return count;
    }
docs: Get the number of nodes in this node list.  The function is probably ill
  named?
  
  
  @param xctxt The XPath runtime context.
  
  @return the number of nodes in this node list.