title: How to find country from ip adress?
body: <p>I am using <a href="http://ipinfodb.com/ip_location_api.php" rel="nofollow">this API</a> to find the country of a user. I am able to find the country on a web page in XML format. <a href="http://api.ipinfodb.com/v3/ip-country/?key=5d3d0cdbc95df34b9db4a7b4fb754e738bce4ac914ca8909ace8d3ece39cee3b&amp;ip=74.125.45.100" rel="nofollow">Here</a> you can see XML file example. But the problem is i can not read this XML in my c# code. Here is my code</p>
  
  <pre><code>string UserIP = Request.ServerVariables["REMOTE_ADDR"].ToString();
  string ApiKey = "5d3d0cdbc95df34b9db4a7b4fb754e738bce4ac914ca8909ace8d3ece39cee3b";
  string Url = "http://api.ipinfodb.com/v3/ip-country/?key=" + ApiKey + "&amp;ip=" + UserIP;
  XDocument xml = XDocument.Load(Url);
  </code></pre>
  
  <p>But this code returns following exception on loading the xml. </p>
  
  <blockquote>
    <p><em>System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.</em></p>
  </blockquote>
  
  <p>Please describe the exact method to read this XML.</p>