To answer your question, the problem with your code lies with the code
While (n.InnerText = "1") ... End While
. You are basically creating an infinite loop with your While statement, since the first node that meets your condition (
n.InnerText = "1"
) will cause the While statement to loop forever.
Change this code...
While (n.InnerText = "1")
Label1.Text = Label1.Text + " " + n.InnerText '// print id text
End While
to this...
If n.InnerText = "1" Then
Label1.Text = Label1.Text + " " + n.InnerText '// print id text
End If
That said, there are better ways to do this.