public void ProcessResponse(XmlDocument locationsResponse)
{
//Create namespace manager
XmlNamespaceManager nsmgr = new XmlNamespaceManager(locationsResponse.NameTable);
nsmgr.AddNamespace("rest", "http://schemas.microsoft.com/search/local/ws/rest/v1");
//Get formatted addresses: Option 1
//Get all locations in the response and then extract the formatted address for each location
XmlNodeList locationElements = locationsResponse.SelectNodes("//rest:Location", nsmgr);
Console.WriteLine("Show all formatted addresses: Option 1");
foreach (XmlNode location in locationElements)
{
//MessageBox.Show("Lat = "+location.SelectSingleNode(".//rest:Latitude", nsmgr).InnerText);
latVal = double.Parse(location.SelectSingleNode(".//rest:Latitude", nsmgr).InnerText);
// MessageBox.Show("lat = " + latVal);
longVal = double.Parse(location.SelectSingleNode(".//rest:Longitude", nsmgr).InnerText);
// MessageBox.Show("Long = " + longVal);
}
// Console.WriteLine();
}