code: public void compose(StylesheetRoot sroot) throws TransformerException
    {
      super.compose(sroot);
      
      // Call compose on each param no matter if this is apply-templates 
      // or call templates.
      int length = getParamElemCount();
      for (int i = 0; i < length; i++) 
      {
        ElemWithParam ewp = getParamElem(i);
        ewp.compose(sroot);
      }
      
  	if ((null != m_templateName) && (null == m_template)) {
  		m_template =
  			this.getStylesheetRoot().getTemplateComposed(m_templateName);
  
  		if (null == m_template) {
  			String themsg =
  				XSLMessages.createMessage(
  					XSLTErrorResources.ER_ELEMTEMPLATEELEM_ERR,
  					new Object[] { m_templateName });
  
  			throw new TransformerException(themsg, this);
  			//"Could not find template named: '"+templateName+"'");
  		}
      
        length = getParamElemCount();
        for (int i = 0; i < length; i++) 
        {
          ElemWithParam ewp = getParamElem(i);
          ewp.m_index = -1;
          // Find the position of the param in the template being called, 
          // and set the index of the param slot.
          int etePos = 0;
          for (ElemTemplateElement ete = m_template.getFirstChildElem(); 
               null != ete; ete = ete.getNextSiblingElem()) 
          {
            if(ete.getXSLToken() == Constants.ELEMNAME_PARAMVARIABLE)
            {
              ElemParam ep = (ElemParam)ete;
              if(ep.getName().equals(ewp.getName()))
              {
                ewp.m_index = etePos;
              }
            }
            else
              break;
            etePos++;
          }
          
        }
      }
    }
docs: This function is called after everything else has been
  recomposed, and allows the template to set remaining
  values that may be based on some other property that
  depends on recomposition.