code: protected ElemVariable addVarDeclToElem(
      ElemTemplateElement psuedoVarRecipient,
      LocPathIterator lpi,
      ElemVariable psuedoVar)
      throws org.w3c.dom.DOMException
    {
      // Create psuedo variable element
      ElemTemplateElement ete = psuedoVarRecipient.getFirstChildElem();
  
      lpi.callVisitors(null, m_varNameCollector);
  
      // If the location path contains variables, we have to insert the 
      // psuedo variable after the reference. (Otherwise, we want to 
      // insert it as close as possible to the top, so we'll be sure 
      // it is in scope for any other vars.
      if (m_varNameCollector.getVarCount() > 0)
      {
        ElemTemplateElement baseElem = getElemFromExpression(lpi);
        ElemVariable varElem = getPrevVariableElem(baseElem);
        while (null != varElem)
        {
          if (m_varNameCollector.doesOccur(varElem.getName()))
            {
            psuedoVarRecipient = varElem.getParentElem();
            ete = varElem.getNextSiblingElem();
            break;
          }
          varElem = getPrevVariableElem(varElem);
        }
      }
  
      if ((null != ete) && (Constants.ELEMNAME_PARAMVARIABLE == ete.getXSLToken()))
      {
        // Can't stick something in front of a param, so abandon! (see variable13.xsl)
        if(isParam(lpi))
          return null;
  
        while (null != ete)
        {
          ete = ete.getNextSiblingElem();
          if ((null != ete) && Constants.ELEMNAME_PARAMVARIABLE != ete.getXSLToken())
              break;
        }
      }
      psuedoVarRecipient.insertBefore(psuedoVar, ete);
      m_varNameCollector.reset();
      return psuedoVar;
    }
docs: Add the given variable to the psuedoVarRecipient.