title: VBA select XML node by attribute
body: <p>I've been searching SO (and the rest of the Internet) for the answer, but I can't seem to find a solution for <strong>selecting an XML node based on an attribute</strong>.</p>
  
  <p>Example XML:</p>
  
  <pre><code>&lt;foo&gt;
      &lt;bar name="do"&gt;A&lt;/bar&gt;
      &lt;bar name="rae"&gt;B&lt;/bar&gt;
      &lt;bar name ="mi"&gt;C&lt;/bar&gt;
  &lt;/foo&gt;
  </code></pre>
  
  <p>So if I want to get <code>B</code> by the <code>rae</code> value of the <code>name</code> attribute, I've tried:</p>
  
  <pre><code>myValue = myXML.selectSingleNode("//foo/bar/").Attributes.getNamedItem("rae").Text
  </code></pre>
  
  <p>Thanks!</p>