code: public void execute(
            TransformerImpl transformer)
              throws TransformerException
    {
  
      if (transformer.currentTemplateRuleIsNull())
      {
        transformer.getMsgMgr().error(this,
          XSLTErrorResources.ER_NO_APPLY_IMPORT_IN_FOR_EACH);  //"xsl:apply-imports not allowed in a xsl:for-each");
      }
  
      int sourceNode = transformer.getXPathContext().getCurrentNode();
      if (DTM.NULL != sourceNode)
      {
        // supply the current templated (matched, not named)        
        ElemTemplate matchTemplate = transformer.getMatchedTemplate();
        transformer.applyTemplateToNode(this, matchTemplate, sourceNode);
      }
      else  // if(null == sourceNode)
      {
        transformer.getMsgMgr().error(this,
          XSLTErrorResources.ER_NULL_SOURCENODE_APPLYIMPORTS);  //"sourceNode is null in xsl:apply-imports!");
      }
    }
docs: Execute the xsl:apply-imports transformation.
  
  @param transformer non-null reference to the the current transform-time state.
  
  @throws TransformerException