'How to retrieve a string/integer from an HTTP response body that's formatted in text/xml in C#? [duplicate]

I'm posting and HTTP request to an API that gives a response formatted in the following way:

<?xml version="1.0" encoding="UTF-8"?>
<FanvilConfiguration cmd="get">
    <RetCode>0</RetCode>
    <info>
        <item> accessList.1.ID=1107275212 </item>
    </info>
</FanvilConfiguration>

Basically, I'm just looking into a list and retrieving people's IDs, and need to check if they're null or invalid. I'm getting the response using

var response1 = (HttpWebResponse)myWebRequest.GetResponse();
response = new StreamReader(response1.GetResponseStream()).ReadToEnd();

How can I retrieve the ID from the response body and store it in a variable?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source