code: public int getLength() {
          if (m_last == -1) {
              int node;
              while ((node = m_iter.next()) != DTMAxisIterator.END) {
                  m_cachedNodes.addElement(node);
              }
              m_last = m_cachedNodes.size();
          }
          return m_last;
      }
docs: The number of nodes in the list. The range of valid child node indices
  is 0 to <code>length-1</code> inclusive.