title: xmllint: Get an item from a list using
body: <p>I read a number of xmllint answers about similar issue, but none seemed applicable to my specific case (maybe I missed it). Anyway, I have a following XML:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;items&gt;
    &lt;item&gt;
      &lt;name&gt;Name 1&lt;/name&gt;
      &lt;value&gt;3&lt;/value&gt;
    &lt;/item&gt;
    &lt;item&gt;
      &lt;name&gt;Name 2&lt;/name&gt;
      &lt;value&gt;4&lt;/value&gt;
      &lt;othervalue&gt;5&lt;/othervalue&gt;
    &lt;/item&gt;
  &lt;/items&gt;
  </code></pre>
  
  <p>I want to select "value" from "item" of a specific name, but when I enter</p>
  
  <pre><code>xmllint --xpath '//items/item[@name="Name 1"]' test.xml
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>XPath set is empty
  -:1: parser error : Document is empty
  </code></pre>
  
  <p>I suspect because "name" is not a property inside the "item" tag, but I'm not sure how deal with that, is there a way to iterate through items and check each one for name (using a bash script perhaps)?</p>