code: public int nextNode()
    {
    	if(m_foundLast)
    		return DTM.NULL;
  
      // Loop through the iterators getting the current fetched 
      // node, and get the earliest occuring in document order
      int earliestNode = DTM.NULL;
  
      if (null != m_iterators)
      {
        int n = m_iterators.length;
        int iteratorUsed = -1;
  
        for (int i = 0; i < n; i++)
        {
          int node = m_iterators[i].getCurrentNode();
  
          if (DTM.NULL == node)
            continue;
          else if (DTM.NULL == earliestNode)
          {
            iteratorUsed = i;
            earliestNode = node;
          }
          else
          {
            if (node == earliestNode)
            {
  
              // Found a duplicate, so skip past it.
              m_iterators[i].nextNode();
            }
            else
            {
              DTM dtm = getDTM(node);
  
              if (dtm.isNodeAfter(node, earliestNode))
              {
                iteratorUsed = i;
                earliestNode = node;
              }
            }
          }
        }
  
        if (DTM.NULL != earliestNode)
        {
          m_iterators[iteratorUsed].nextNode();
  
          incrementCurrentPos();
        }
        else
          m_foundLast = true;
      }
  
      m_lastFetched = earliestNode;
  
      return earliestNode;
    }
docs: Returns the next node in the set and advances the position of the
  iterator in the set. After a DTMIterator is created, the first call
  to nextNode() returns the first node in the set.
  @return  The next <code>Node</code> in the set being iterated over, or
  <code>null</code> if there are no more members in that set.