title: How to parse XML and get instances of a particular node attribute?
body: <p>I have many rows in XML and I'm trying to get instances of a particular node attribute.</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;foo&gt;
     &lt;bar&gt;
        &lt;type foobar=&quot;1&quot;/&gt;
        &lt;type foobar=&quot;2&quot;/&gt;
     &lt;/bar&gt;
  &lt;/foo&gt;
  </code></pre>
  <p>How do I access the values of the attribute <code>foobar</code>? In this example, I want <code>&quot;1&quot;</code> and <code>&quot;2&quot;</code>.</p>