How to parse xml in c#?

Always loved parsing, hence the gap.
Now I do so on the server form the document type

<root>
<top>
<record>Ivan 500</record>
<record>Igor 250</record>
<record>Lena 750</record>
</top>
</root>

Then Sharpe party:
XmlDocument xmldoc = new XmlDocument();
xmldoc.LoadXml(callbackLine.ToString());
Xmlnodli XmlNodeList = xmldoc.SelectNodes("Root/top/record");
int num = xmlnodli.Count;
foreach (XmlNode xm in xmlnodli)
{
// here xm.InnerText; contains Lena 750, etc
}

but I is not convenient to build UI because of this, it is necessary that Lena was in a separate variable and 750 separate. If necessary, an xml document can create any kind)
July 8th 19 at 16:30
2 answers
July 8th 19 at 16:32
Solution
Here is the solution to the problem)
XDocument doc = XDocument.Parse(callbackLine.ToString());

 foreach (XElement el in doc.Root.Elements())
{

 print(el.Attribute("username").Value + "" + el.Attribute("record").Value);
 }
How strange question is so strange and the answer.

// need to Lena was in a separate variable and a separate 750.
// If necessary, an xml document can create any kind)

And here the parsing, if the solution to Your question is given by the change in server XML??? - Rosalinda.Leannon commented on July 8th 19 at 16:35
: so I didn't know what kind of the right document - westley commented on July 8th 19 at 16:38
July 8th 19 at 16:34
0. Themselves form file and are complaining about its contents........
1. fill the gaps
2. there are json, xml why ?
3. in any case, you can deserialize and do not suffer from query
the fact that I use unity and to work with json need a huge Liba, a xml out of the box is) - Rosalinda.Leannon commented on July 8th 19 at 16:37
: there is a deserialization from xml for simple features? I think it is.
How huge? You know better. - westley commented on July 8th 19 at 16:40
what is the meaning of your answers? - westley commented on July 8th 19 at 16:43
:
Tried to fill some gaps.
The solution to the problem articulated in paragraph 0.
Successfully Google. - mercedes commented on July 8th 19 at 16:46
: and I thought you their national feature of Jaro decided to show - westley commented on July 8th 19 at 16:49
: If it was meant unity3d, there is JSONUtility for example. - mercedes commented on July 8th 19 at 16:52
Too big of Liba. Alas - westley commented on July 8th 19 at 16:55
: for mobile game speed is critical, - Sister.OConner74 commented on July 8th 19 at 16:58

Find more questions by tags C#XMLParsing