code: public boolean visitInstruction(ElemTemplateElement elem)
    {
      int type = elem.getXSLToken();
      switch (type)
      {
        case Constants.ELEMNAME_CALLTEMPLATE :
        case Constants.ELEMNAME_TEMPLATE :
        case Constants.ELEMNAME_FOREACH :
          {
            
            // Just get the select value.
            if(type == Constants.ELEMNAME_FOREACH)
            {
              ElemForEach efe = (ElemForEach) elem;
     		    
    		    Expression select = efe.getSelect();
    		    select.callVisitors(efe, this);
            }
           
    		  Vector savedPaths = m_paths;
    		  m_paths = new Vector();
    		    
    		  // Visit children.  Call the superclass callChildVisitors, because 
    		  // we don't want to visit the xsl:for-each select attribute, or, for 
    		  // that matter, the xsl:template's match attribute.
    		  elem.callChildVisitors(this, false);  		
    		  eleminateRedundentLocals(elem);
    		    
    		  m_paths = savedPaths;
   
            // select.callVisitors(efe, this);
            return false;
          }
        case Constants.ELEMNAME_NUMBER :
        case Constants.ELEMNAME_SORT :
          // Just collect absolute paths until and unless we can fully
          // analyze these cases.
          boolean savedIsSame = m_isSameContext;
          m_isSameContext = false;
          elem.callChildVisitors(this);
          m_isSameContext = savedIsSame;
          return false;
          
        default :
          return true;
      }
    }
docs: Visit an XSLT instruction.  Any element that isn't called by one
  of the other visit methods, will be called by this method.
  
  @param elem The xsl instruction element object.
  @return true if the sub expressions should be traversed.