title: Case insensive filter nodes from XML with XSL transform
body: <p>I am using XSLT 1.0. I have an XML document:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;profile&gt;
      &lt;properties&gt;
          &lt;property&gt;
              &lt;name&gt;Email&lt;/name&gt;
              &lt;value&gt;test@mail.com&lt;/value&gt;
          &lt;/property&gt;
          &lt;property&gt;
              &lt;name&gt;joinDate&lt;/name&gt;
              &lt;value&gt;1590438658&lt;/value&gt;
          &lt;/property&gt;
          &lt;property&gt;
              &lt;name&gt;LAST_LOGIN&lt;/name&gt;
              &lt;value&gt;1591638684&lt;/value&gt;
          &lt;/property&gt;
          &lt;property&gt;
              &lt;name&gt;address&lt;/name&gt;
              &lt;value&gt;1197 Franklin Street, Independence, Oregon 97351&lt;/value&gt;
          &lt;/property&gt;
          &lt;!-- ... --&gt;
      &lt;/properties&gt;
  &lt;/profile&gt;
  </code></pre>
  
  <p>The property names have inconsistent cases, and they can change per document (e.g. <code>Email</code> might be <code>email</code> in another document). <strong>I want to keep <code>property</code> nodes based on the case-insensitive value of the <code>name</code> tag.</strong></p>
  
  <p>For instance, I want to keep <code>property</code> nodes with <code>name</code> equal to <code>email</code> or <code>address</code> (case-insensitive).</p>
  
  <p>Expected output:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;profile&gt;
      &lt;properties&gt;
          &lt;property&gt;
              &lt;name&gt;Email&lt;/name&gt;
              &lt;value&gt;test@mail.com&lt;/value&gt;
          &lt;/property&gt;
          &lt;property&gt;
              &lt;name&gt;address&lt;/name&gt;
              &lt;value&gt;1197 Franklin Street, Independence, Oregon 97351&lt;/value&gt;
          &lt;/property&gt;
          &lt;!-- ... --&gt;
      &lt;/properties&gt;
  &lt;/profile&gt;
  </code></pre>
  
  <p>I have tried this XSL transform, but it is not case-insensitive:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
      &lt;xsl:output method="xml" omit-xml-declaration="yes" /&gt;
  
      &lt;xsl:template match="*[local-name()='property'][not(*[local-name()='name']
          [.='email' or .='address']
          )]"/&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:stylesheet&gt;
  </code></pre>