title: Remove Elements and/or Attributes by Name per XSL Parameters
body: <p>The following does the job of removing unwanted elements and attributes by name ("removeMe" in this example) from an XML file:</p>
  
  <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  
   &lt;xsl:output omit-xml-declaration="yes" indent="yes"/&gt;
  
   &lt;xsl:template match="node() | @*" name="identity"&gt;
    &lt;xsl:copy&gt;
     &lt;xsl:apply-templates select="node() | @*"/&gt;
    &lt;/xsl:copy&gt;
   &lt;/xsl:template&gt;
  
   &lt;xsl:template match="removeMe"/&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>The problems are it does not distinguish between elements and attributes, the name is hard-coded, and it can only take one name. <strong>How could this be rewritten to use a couple input parameters like below to remove one or more specific elements and/or attributes?</strong></p>
  
  <pre><code>&lt;xsl:param name="removeElementsNamed"/&gt;
  &lt;xsl:param name="removeAttributesNamed"/&gt;
  </code></pre>
  
  <p><strong>The desired result is the ability to remove</strong> <em>one or more</em> <strong>elements and/or</strong> <em>one or more</em> <strong>attributes while still distinguishing between elements and attributes</strong> (in other words, it should be possible to remove all "time" <em>elements</em> <strong>without</strong> also removing all "time" <em>attributes</em>).</p>
  
  <p>While I required XSLT 1.0 this round, XSLT 2.0 solutions in accepted and other answers may be useful to others.</p>