Using the SelectNodes Method with XML Namespaces - .Net Framework

The following code demonstrates how to use the XmlNode.SelectNodes() method with XML Namespaces.

Dim doc As XmlDocument = New XmlDocument()
doc.Load(uxOpenFileDialog.FileName)

Dim nsm As XmlNamespaceManager _
  = New XmlNamespaceManager(doc.NameTable)

nsm.AddNamespace("soap", _
    "http://schemas.xmlsoap.org/soap/envelope/")

Dim soapDataNodes As XmlNodeList = Nothing

soapDataNodes = doc.SelectNodes("soap:Envelope/soap:Body/INPUT", nsm)