title: XSLT: filter out result except given list
body: <p>I would like to filter out elements except some in a list.</p>
  
  <p>I have this XML:</p>
  
  <pre><code>&lt;catalog&gt;
     &lt;product&gt;
        &lt;code&gt;Y17231&lt;/code&gt;
        &lt;pname&gt;Test 1&lt;/pname&gt;
     &lt;/product&gt;
     &lt;product&gt;
        &lt;code&gt;Y19232&lt;/code&gt;
        &lt;pname&gt;Test 2&lt;/pname&gt;
     &lt;/product&gt;
     &lt;product&gt;
        &lt;code&gt;Y18333&lt;/code&gt;
        &lt;pname&gt;Test 3&lt;/pname&gt;
     &lt;/product&gt;
  &lt;/catalog&gt;
  </code></pre>
  
  <p>Currently I am filtering out all elements, which are not starting with Y19* code.</p>
  
  <pre><code>&lt;xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
      &lt;xsl:output encoding="UTF-8" indent="yes" method="xml"/&gt;
  
      &lt;xsl:strip-space elements="*" /&gt;
  
      &lt;xsl:template match="node()|@*"&gt;
            &lt;xsl:copy&gt;
               &lt;xsl:apply-templates select="node()|@*"/&gt;
            &lt;/xsl:copy&gt;
      &lt;/xsl:template&gt;
  
      &lt;xsl:template match="product[not(matches(code, 'Y[^X]?19.*[^V]$'))]" /&gt;
  
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>This is working, <a href="http://xsltransform.net/bESZULm" rel="nofollow noreferrer">xsltransform</a> example, example output:</p>
  
  <pre><code>&lt;catalog&gt;
     &lt;product&gt;
        &lt;code&gt;Y19232&lt;/code&gt;
        &lt;pname&gt;Test 2&lt;/pname&gt;
     &lt;/product&gt;
  &lt;/catalog&gt;
  </code></pre>
  
  <p><strong>The goal:</strong> </p>
  
  <p>I would like to extend this with a feature, where I can define some codes, which are then not filtered out (they will be included in the result).</p>
  
  <pre><code>&lt;xsl:param name="include-this" as="xs:string*" select="'Y18333','Y16222','Y12333'"/&gt;
  </code></pre>
  
  <p>So output should be this:</p>
  
  <pre><code>&lt;catalog&gt;
     &lt;product&gt;
        &lt;code&gt;Y19232&lt;/code&gt;
        &lt;pname&gt;Test 2&lt;/pname&gt;
     &lt;/product&gt;
     &lt;product&gt;
        &lt;code&gt;Y18333&lt;/code&gt;
        &lt;pname&gt;Test 3&lt;/pname&gt;
     &lt;/product&gt;
  &lt;/catalog&gt;
  </code></pre>
  
  <p>Can you help me how to achieve my goal?</p>