looping through XML file using VB.NET <p>I am having a problem processing an XMl file. I want to loop through (using VB.NET) the file and extract all the values of the OrderID element. </p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;ListOrdersResponse xmlns="https://xxx.xxxxxx.com/Orders/999uuu777"&gt; &lt;ListOrdersResult&gt; &lt;NextToken&gt;XXXXXXXXXX&lt;/NextToken&gt; &lt;Orders&gt; &lt;Order&gt; &lt;ShipmentServiceLevelCategory&gt;Standard&lt;/ShipmentServiceLevelCategory&gt; &lt;OrderId&gt;ooooooooo&lt;/OrderId&gt; &lt;/Order&gt; &lt;Order&gt; &lt;ShipmentServiceLevelCategory&gt;Standard&lt;/ShipmentServiceLevelCategory&gt; &lt;OrderId&gt;ujuujujuj&lt;/OrderId&gt; &lt;/Order&gt; &lt;/Orders&gt; &lt;CreatedBefore&gt;2013-06-19T09:10:47Z&lt;/CreatedBefore&gt; &lt;/ListOrdersResult&gt; &lt;ResponseMetadata&gt; &lt;RequestId&gt;8e34f7d9-3af7-4490-801b-cccc7777yu&lt;/RequestId&gt; &lt;/ResponseMetadata&gt; &lt;/ListOrdersResponse&gt; </code></pre> <p>Here is the code I am trying but it does not loop through each order</p> <pre class="lang-vb prettyprint-override"><code>Dim doc As New XmlDocument() doc.Load(file) Dim nodelist As XmlNodeList = doc.SelectNodes(".//Orders/Order") For Each node As XmlElement In nodelist console.writeline(node.SelectSingleNode("OrderID").InnerText) Next </code></pre> <p>Any help would be gratefully appreciated.</p>