title: How to get node values in XML using VBScript?
body: <p>I'm trying to save all the repeated nodes to an array for my QTP automation.</p>
  
  <p>When we use the below code we get all the repeated nodes present in the XML.
  Example:</p>
  
  <pre class="lang-vb prettyprint-override"><code>strXmlPCoverage = /cts:InsuranceClaim/cts:MedicalClaim
  
  Set nodes = xmlDoc.SelectNodes(strXmlPCoverage)
  PathLength = nodes.Length
  </code></pre>
  
  <p>Let's say the <code>PathLength</code> returned "6" tags present in the XML as repeated tags.</p>
  
  <pre>/cts:InsuranceClaim/cts:MedicalClaim[0]
  /cts:InsuranceClaim/cts:MedicalClaim[1]
  /cts:InsuranceClaim/cts:MedicalClaim[2]
  /cts:InsuranceClaim/cts:MedicalClaim[3]
  /cts:InsuranceClaim/cts:MedicalClaim[4]
  /cts:InsuranceClaim/cts:MedicalClaim[5]</pre>
  
  <p>Now I want to save all those 6 different paths to array. I'm not able to identify the property that displays the values stored in <code>nodes</code>.</p>
  
  <pre class="lang-vb prettyprint-override"><code>Set nodes = xmlDoc.SelectNodes(strXmlPCoverage)
  PathLength = nodes.Length
  For Each NodeItem In nodes
      ArrAllNodes(i) = NodeItem.nodeValue
  Next
  </code></pre>
  
  <p>The above code stores value of that node to Array instead of the node itself. Can you please help me how to store the nodes to array instead of node values</p>
  
  <p><strong>Output displayed by the code:</strong></p>
  
  <pre class="lang-vb prettyprint-override"><code>ArrAllNodes(0) = abc
  ArrAllNodes(1) = xyz
  ...
  </code></pre>
  
  <p><strong>Output Expected:</strong></p>
  
  <pre class="lang-vb prettyprint-override"><code>ArrAllNodes(0) = /cts:InsuranceClaim/cts:MedicalClaim[0]
  ArrAllNodes(1) = /cts:InsuranceClaim/cts:MedicalClaim[1]
  ...
  </code></pre>