トマラクがすでに観察しているように、あなたの質問はかなり漠然としています。3 種類のヘッダーに対して 1 つのテンプレートを作成する方法を尋ねているように思えます。
<xsl:template match="headerA | headerB | headerC">
<span>
<xsl:apply-templates/>
</span>
</xsl:template>
または、類似しているが異なるテンプレートを作成する方法:
<xsl:template match="headerA">
<span> Type A </span>
</xsl:template>
<xsl:template match="headerB">
<span> Type B </span>
</xsl:template>
<!--* Template for headerC left as an exercise for the reader *-->
または、一致するものに基づいてわずかに異なることを行う単一のテンプレートを作成する方法:
<xsl:template match="headerA | headerB | headerC">
<span>
<xsl:choose>
<xsl:when test="self::headerA">
<xsl:text> Type A </xsl:type>
</xsl:when>
<xsl:when test="self::headerB">
<xsl:text> Type B </xsl:type>
</xsl:when>
<!--* etc. *-->
<xsl:otherwise>
<xsl:message terminate="yes"
>I thought this could not happen.</xsl:message>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates/>
</span>
</xsl:template>
これらのどれが役立つかがわかれば、何を質問しようとしているのかをより理解できるようになります。