title: Classic ASP to loop through XML to find and display details for one node
body: <p>I have an XML file containing details about individual users. When they visit a web page, I want to find their node and display the relevant information. I've been trying several example codes found here but there are some methods or properties I don't know how to access.</p>
  
  <p>This is the XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;data&gt;
    &lt;user id="001" name="Maria"&gt;
      &lt;godate&gt;2015-01-01&lt;/godate&gt;
      &lt;serials&gt;
        &lt;serial&gt;AA-12345-1&lt;/serial&gt;
      &lt;/serials&gt;
    &lt;/user&gt;
    &lt;user id="002" name="Domingo"&gt;
      &lt;godate&gt;2015-02-02&lt;/godate&gt;
      &lt;serials&gt;
        &lt;serial&gt;BB-12345-1&lt;/serial&gt;
        &lt;serial&gt;BB-12345-2&lt;/serial&gt;
      &lt;/serials&gt;
    &lt;/user&gt;
    &lt;user id="003" name="Michael"&gt;
      &lt;godate&gt;2015-03-03&lt;/godate&gt;
      &lt;serials&gt;
        &lt;serial&gt;CC-12345-1&lt;/serial&gt;
        &lt;serial&gt;CC-12345-2&lt;/serial&gt;
        &lt;serial&gt;CC-12345-3&lt;/serial&gt;
      &lt;/serials&gt;
    &lt;/user&gt;
  &lt;/data&gt;
  </code></pre>
  
  <p>I need to find a node based on the ID attribute, and then display the value of the godate and the values (1 to n) of their serials. So, for Domingo the output should show:</p>
  
  <p>Go Date: 2015-02-02<br>
  Serial 1: BB-12345-1<br>
  Serial 2: BB-12345-2  </p>
  
  <p>So far the closest I've been able to come is to display all the godate values and all the serial values, but I don't know how to limit the results to one user (based on ID) and only show the godate and serials for that one user.</p>
  
  <p>This is the ASP code I have so far:</p>
  
  <pre><code>&lt;%
      Set objXMLDoc = CreateObject("Microsoft.XMLDOM") 
      objXMLDoc.async = False 
      objXMLDoc.load(Server.MapPath("data.xml"))
  
      Set Root = objXMLDoc.documentElement
      Set NodeList = Root.getElementsByTagName("user")
  
      For i = 0 to NodeList.length -1 
          Set GoDate = objXMLDoc.getElementsByTagName("godate")(i)
          response.write "Go Date: " &amp; godate.text &amp; "&lt;br&gt;"
          Set Serials = objXMLDoc.getElementsByTagName("serials")(i)
          response.write "Serials: " &amp; serials.text &amp; "&lt;br&gt;"
      Next
  %&gt;
  </code></pre>
  
  <p>How can I find the ID attribute and then only get the data for that node?</p>