 <p>Unfortunately, it is illegal to reference a variable/param in a match pattern in XSLT 1.0. However, you can reference your <code>$lang</code> parameter any time you apply templates. So, for example, in the root template (i.e. a template that matches <code>/</code> or some other sufficiently top-level node), you could specify that you only want to apply templates to elements that have an <code>xml:lang</code> attribute equal to the value of your param (or no <code>xml:lang</code> at all):</p> <pre><code>&lt;xsl:apply-templates select="*[not(@xml:lang) or @xml:lang=$lang]" /&gt; </code></pre> <p>This won't process any undesired elements and no other templates need to specify the language to match.</p>