title: How to parse an xml response from a post in vb.net
body: <p>I am posting to a website to get data back. The site returns it as an xml. I am able to get the data into a string. But what i really want to do is to have each item in the xml in a different string field.</p>
  
  <pre><code>Sub lookup(ByVal Source As Object, ByVal e As EventArgs)
    Dim wData As String
    wData = WRequest("http://PostToThisSite.com", "POST","str=31&amp;Password=pn&amp;UserID=Q&amp;Postcode="+txtPcode.Text)       
    Response.Write(wData)
  End Sub
  
  Function WRequest(URL As String, method As String, POSTdata As String) As String
      Dim responseData As String = ""
        Try
          Dim hwrequest As Net.HttpWebRequest = Net.Webrequest.Create(URL)
          hwrequest.Accept = "*/*"
          hwrequest.AllowAutoRedirect = true
          hwrequest.UserAgent = "http_requester/0.1"
          hwrequest.Timeout = 60000
          hwrequest.Method = method
          If hwrequest.Method = "POST" Then
            hwrequest.ContentType = "application/x-www-form-urlencoded"
            Dim encoding As New Text.ASCIIEncoding() 'Use UTF8Encoding for XML requests
            Dim postByteArray() As Byte = encoding.GetBytes(POSTdata)
            hwrequest.ContentLength = postByteArray.Length
            Dim postStream As IO.Stream = hwrequest.GetRequestStream()
            postStream.Write(postByteArray, 0, postByteArray.Length)
            postStream.Close()
          End If
          Dim hwresponse As Net.HttpWebResponse = hwrequest.GetResponse()
          If hwresponse.StatusCode = Net.HttpStatusCode.OK Then
            Dim responseStream As IO.StreamReader = _
              New IO.StreamReader(hwresponse.GetResponseStream())
            responseData = responseStream.ReadToEnd()
          End If
          hwresponse.Close()
          Catch e As Exception
            responseData = "An error occurred: " &amp; e.Message
          End Try
        Return responseData
  End Function
  </code></pre>
  
  <p>The above code works and writes out a line...</p>
  
  <p>Some Road City LU1 5QG</p>
  
  <p>The Xml being returned is ..</p>
  
  <pre><code>&lt;Address xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://site.co.uk/"&gt;
    &lt;strOrganisation /&gt; 
    &lt;strProperty /&gt; 
    &lt;strStreet&gt;Some Road&lt;/strStreet&gt; 
    &lt;strLocality /&gt; 
    &lt;strTown&gt;City&lt;/strTown&gt; 
    &lt;strCounty /&gt; 
    &lt;strPostcode&gt;LU1 5QG&lt;/strPostcode&gt; 
    &lt;strDPS /&gt; 
  </code></pre>
  
  <p>I want to be able to split these fields and set them to different text boxes on the page...help?</p>