title: Extracting XML data to php
body: <p>I'm trying to extract data from XML file (<a href="http://freegeoip.net/xml/google.com" rel="nofollow">http://freegeoip.net/xml/google.com</a>). You can see the content of the file looks something like:</p>
  
  <pre><code>&lt;Response&gt;
  &lt;Ip&gt;74.125.235.3&lt;/Ip&gt;
  &lt;CountryCode&gt;US&lt;/CountryCode&gt;
  &lt;CountryName&gt;United States&lt;/CountryName&gt;
  &lt;RegionCode&gt;CA&lt;/RegionCode&gt;
  &lt;RegionName&gt;California&lt;/RegionName&gt;
  &lt;City&gt;Mountain View&lt;/City&gt;
  &lt;ZipCode&gt;94043&lt;/ZipCode&gt;
  &lt;Latitude&gt;37.4192&lt;/Latitude&gt;
  &lt;Longitude&gt;-122.0574&lt;/Longitude&gt;
  &lt;MetroCode&gt;807&lt;/MetroCode&gt;
  &lt;AreaCode&gt;650&lt;/AreaCode&gt;
  &lt;/Response&gt;
  </code></pre>
  
  <p>I want to take the information stored in the <code>&lt;latitude&gt;</code> and <code>&lt;longitude&gt;</code> tags, and store them in separate variables. The problem is, I've little idea how to do this, and was wondering if anyone could show me how to parse XML files with php?</p>