code: private StringVector getNodesByID(XPathContext xctxt, int docContext,
                                      String refval, StringVector usedrefs,
                                      NodeSetDTM nodeSet, boolean mayBeMore)
    {
  
      if (null != refval)
      {
        String ref = null;
  //      DOMHelper dh = xctxt.getDOMHelper();
        StringTokenizer tokenizer = new StringTokenizer(refval);
        boolean hasMore = tokenizer.hasMoreTokens();
        DTM dtm = xctxt.getDTM(docContext);
  
        while (hasMore)
        {
          ref = tokenizer.nextToken();
          hasMore = tokenizer.hasMoreTokens();
  
          if ((null != usedrefs) && usedrefs.contains(ref))
          {
            ref = null;
  
            continue;
          }
  
          int node = dtm.getElementById(ref);
  
          if (DTM.NULL != node)
            nodeSet.addNodeInDocOrder(node, xctxt);
  
          if ((null != ref) && (hasMore || mayBeMore))
          {
            if (null == usedrefs)
              usedrefs = new StringVector();
  
            usedrefs.addElement(ref);
          }
        }
      }
  
      return usedrefs;
    }
docs: Fill in a list with nodes that match a space delimited list if ID
  ID references.
  
  @param xctxt The runtime XPath context.
  @param docContext The document where the nodes are being looked for.
  @param refval A space delimited list of ID references.
  @param usedrefs List of references for which nodes were found.
  @param nodeSet Node set where the nodes will be added to.
  @param mayBeMore true if there is another set of nodes to be looked for.
  
  @return The usedrefs value.