title: Querying XML satisfying two conditions with Excel VBA
body: <p>I am building Excel VBA code to query value satisfying two conditions.</p>
  
  <p>XML data is</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Sales&gt;
      &lt;Sale&gt;
          &lt;Name&gt;John&lt;/Name&gt;
          &lt;Area&gt;NY&lt;/Area&gt;
          &lt;Data Date="20200401"&gt;
              &lt;Target&gt;110&lt;/Target&gt;
              &lt;Actual&gt;80&lt;/Actual&gt;
          &lt;/Data&gt;
          &lt;Data Date="20200402"&gt;
              &lt;Target&gt;110&lt;/Target&gt;
              &lt;Actual&gt;80&lt;/Actual&gt;
          &lt;/Data&gt;
      &lt;/Sale&gt;
  &lt;/Sales&gt;
  </code></pre>
  
  <p>and VBA code is like below,</p>
  
  <pre><code>Dim doc As Object
  
  Set doc = CreateObject("MSXML2.DOMDocument")
  doc.async = False: doc.validateOnParse = False
  doc.Load ("C:\vb\sales.xml")
  
  Set Nodes = doc.SelectNodes("//Sales/Sale[Name='John' and /Data/@Date='20200401']/Data")
  
  For Each Node In Nodes
       Debug.Print Node.SelectSingleNode("Actual").Text
  Next Node
  
  Set doc = Nothing
  </code></pre>
  
  <p>The code below is wrong, could you advise to fix it?</p>
  
  <pre><code>doc.SelectNodes("//Sales/Sale[Name='John' and /Data/@Date='20200401']/Data")
  </code></pre>