code: public void reset()
    {
  
      if (!m_hasBeenReset && m_shouldReset)
      {
        m_hasBeenReset = true;
  
        if (this.m_outputStream != null)
        {
          try
          {
            m_outputStream.close();
          }
          catch (java.io.IOException ioe){}
        }
  
        m_outputStream = null;
  
        // I need to look more carefully at which of these really
        // needs to be reset.
        m_countersTable = null;
  
        m_xcontext.reset();
        
        m_xcontext.getVarStack().reset();
        resetUserParameters();
        
  
        m_currentTemplateElements.removeAllElements();     
        m_currentMatchTemplates.removeAllElements();
        m_currentMatchedNodes.removeAllElements();
        
        m_serializationHandler = null;      
        m_outputTarget = null;
        m_keyManager = new KeyManager();
        m_attrSetStack = null;
        m_countersTable = null;
        m_currentTemplateRuleIsNull = new BoolStack();
        // m_xmlSource = null; // android-removed
        m_doc = DTM.NULL;
        // m_isTransformDone = false; // android-removed
        m_transformThread = null;
  
        // m_inputContentHandler = null;
        // For now, reset the document cache each time.
        m_xcontext.getSourceTreeManager().reset();
      }
  
      //    m_reportInPostExceptionFromThread = false;
    }
docs: Reset the state.  This needs to be called after a process() call
  is invoked, if the processor is to be used again.