code: public Node item(int index) {
          if (m_iter != null) {
              int node;
              int count = m_cachedNodes.size();
  
              if (count > index) {
                  node = m_cachedNodes.elementAt(index);
                  return m_dtm.getNode(node);
              } else if (m_last == -1) {
                  while (((node = m_iter.next()) != DTMAxisIterator.END)
                             && count <= index) {
                      m_cachedNodes.addElement(node);
                      count++;
                  }
                  if (node == DTMAxisIterator.END) {
                      m_last = count;
                  } else {
                      return m_dtm.getNode(node);
                  }
              }
          }
          return null;
      }
docs: Returns the <code>index</code>th item in the collection. If
  <code>index</code> is greater than or equal to the number of nodes in
  the list, this returns <code>null</code>.
  @param index Index into the collection.
  @return The node at the <code>index</code>th position in the
  <code>NodeList</code>, or <code>null</code> if that is not a valid
  index.