if (lDoc == null) lDoc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
if (m_doc == null) { synchronized (m_instance) { if (m_doc == null) m_doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); } }
  public static NodeList tokenize(String toTokenize, String delims)  {    try    {      if (lDoc == null)        lDoc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();    }    catch(ParserConfigurationException pce)    {      throw new org.apache.xml.utils.WrappedRuntimeException(pce);    }    NodeSet resultSet = new NodeSet();        if (delims != null && delims.length() > 0)    {      StringTokenizer lTokenizer = new StringTokenizer(toTokenize, delims);      while (lTokenizer.hasMoreTokens())      {        Element element = lDoc.createElement("token");        element.appendChild(lDoc.createTextNode(lTokenizer.nextToken()));        resultSet.addNode(element);            }    }    // If the delimiter is an empty string, create one token Element for     // every single character.    else    {      for (int i = 0; i < toTokenize.length(); i++)      {        Element element = lDoc.createElement("token");        element.appendChild(lDoc.createTextNode(toTokenize.substring(i, i+1)));        resultSet.addNode(element);                    }    }    return resultSet;  }