title: xpath to select an attribute value where another attribute is a predicate
body: <p>Say my XML node is this simple:</p>
  
  <pre><code>&lt;foo&gt;
      &lt;bar id="1" name="John" /&gt;
      &lt;bar id="2" name="Bill"&gt;
          &lt;qwert name="Tony" /&gt;
      &lt;/bar&gt;
  &lt;/foo&gt;
  </code></pre>
  
  <p>What's the xpath expression to select the name value where I have matched an id already?</p>
  
  <p><code>//foo/bar@name</code> will return the name attributes, but if I want to match an exiting attribute and then return the name, a-la</p>
  
  <p><code>//foo/bar[id='1']@name</code></p>
  
  <p>throws</p>
  
  <blockquote>
    <p>Uncaught Error: INVALID_EXPRESSION_ERR: DOM XPath Exception 51 </p>
  </blockquote>