title: Print multiple matching element names
body: <p>I'm attempting to print the names of multiple elements, but I can only convince XPath to output one.</p>
  
  <p>Given this XML:</p>
  
  <pre><code>&lt;xml&gt;
      &lt;foob&gt;931&lt;/foob&gt;
      &lt;arba&gt;478&lt;/arba&gt;
      &lt;zfoo&gt;892&lt;/zfoo&gt;
  &lt;/xml&gt;
  </code></pre>
  
  <p>I try this and get <code>foob</code>:</p>
  
  <pre><code>name(//*[contains(name(), "foo")])
  </code></pre>
  
  <p>I try this and get an error about an invalid expression:</p>
  
  <pre><code>//*[contains(name(), "foo")]/name()
  </code></pre>
  
  <p>Although this works fine: </p>
  
  <pre><code>//*[contains(name(), "foo")]/text()
  </code></pre>
  
  <p>I'm on the command line, and have tried both <code>xmllint</code> and <code>xpath</code> (from Perl's XML-XPath module) with the same results.</p>
  
  <p>How can I get <i>both</i> <code>foob</code> and <code>zfoo</code> returned?</p>