I get the xml file as follows

string resp = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<response list=\"true\">\n <uid>182194</uid>\n <uid>2283152</uid>\n <uid>5637297</uid>.... 

It is necessary to get all the uid using the following code in C #

 XDocument doc = XDocument.Parse(resp); var points = doc.Descendants("response"); foreach (XElement curent in points) { string a = curent.Element("uid").Value; pad.WriteLine("id" + a); } 

But you manage to get only one uid, after that he get out of the cycle.

    1 answer 1

    var points = doc.Descendants ("response");

    with this action, you get only one <response...> element on which the loop is executed only once.

    The solution is quite simple:

     XDocument doc = XDocument.Parse(resp); var points = doc.Descendants("uid"); foreach (XElement curent in points) { string a = curent.Value; Console.WriteLine("id" + a); }