title: Combine multiple XSLT templates with similar matches
body: <p>I have this XSLT below</p>
  <pre><code>&lt;xsl:template match=&quot;word[@italic = 'y']&quot;&gt;
          &lt;p&gt;
                  &lt;xsl:attribute name=&quot;i&quot;&gt;yes&lt;/xsl:attribute&gt;
                  &lt;xsl:apply-templates/&gt;
          &lt;/p&gt;
  &lt;/xsl:template&gt;
  
  &lt;xsl:template match=&quot;word[@bold = 'y']&quot;&gt;
          &lt;p&gt;
                  &lt;xsl:attribute name=&quot;b&quot;&gt;yes&lt;/xsl:attribute&gt;
                  &lt;xsl:apply-templates/&gt;
          &lt;/p&gt;
  &lt;/xsl:template&gt;
  
  &lt;xsl:template match=&quot;word[@underline = 'y']&quot;&gt;
          &lt;p&gt;
                  &lt;xsl:attribute name=&quot;u&quot;&gt;yes&lt;/xsl:attribute&gt;
                  &lt;xsl:apply-templates/&gt;
          &lt;/p&gt;
  &lt;/xsl:template&gt;
  </code></pre>
  <p>Is there a way to combine these templates in a single nested block, using a variable that looks something like &quot;italic | bold | underline&quot;, while also reflecting the changes in &lt;xsl:attribute name=&quot;XXX&quot;&gt;? Thanks.</p>