Q:

How to get value of child node elements from XDocument in c#

I am trying to access values in an xml response to Bing Maps API. I tried doing something like var responseXml = xdoc.Root.Element("Response").Element("ResourceSets").Element("ResourceSet").Element("EstimatedTotal").Value;, but it resulted in an error.  
Any idea on how to solve this issue?
code
private void RequestCompleted(IAsyncResult result)
{
    var request = (HttpWebRequest)result.AsyncState;
    var response = (HttpWebResponse)request.EndGetResponse(result);
    StreamReader stream = new StreamReader(response.GetResponseStream());

    try
    {
        XDocument xdoc = XDocument.Load(stream);

        var responseXml = xdoc.Root.Element("Response").Element("ResourceSets").Element("ResourceSet").Element("EstimatedTotal").Value;
    }
    catch (Exception ex)
    {
        MessageBox.Show("Error" + ex.Message);
    }
    }

xml response

A:

Don't know the exact question you're asking Virtual Earth, but you posted a picture of the xml which doesn't exactly give us a clearer picture of the xml.
however, try
var responseXml = xdoc.Descendants("ResourceSets");

That should return an enumerable of XElements containing one to many "ResourceSet" XElements. Those XElements could be queried for Lat/Long with:
var locations = responseXml.Descendents("GeocodePoint");

foreach (var loci in locations) 
    {
        Console.WriteLine(string.Format("Lat: {0} Long: {1}", loci.Element("Latitude"), loci.Element("Longitude"));
    }

Use the debugger at that line and play with the xDoc object. It has lots of properties and methods which may be of use.

