title: How to Parse Sitemap XML Content using PHP
body: <p>I have site that is on wordpress. I want to make a PHP Script that will parse XML content from the URL and show me in the form of table.</p>
  
  <p>I had written below PHP Script to parse the data</p>
  
  <pre><code>&lt;?php
  $xml = simplexml_load_string(file_get_contents($url));
  foreach ($xml-&gt;url as $url)
  {
      ?&gt;
      Loc: &lt;?php echo $url-&gt;loc; ?&gt;
      &lt;br /&gt;
      Last Modified: &lt;?php echo $url-&gt;lastmod; ?&gt;
      &lt;br /&gt;
      Image Title: &lt;?php echo $xml-&gt;children('image', true)-&gt;image-&gt;title; ?&gt;
      &lt;br /&gt;
      Image Location: &lt;?php echo $xml-&gt;children('image', true)-&gt;image-&gt;loc; ?&gt;
      &lt;hr /&gt;
      &lt;?php
  }
  ?&gt;
  </code></pre>
  
  <p><strong>Problem</strong>
  The Above PHP Script is working fine to parse Loc &amp; Last Modified But <strong>Not Working for Image Loc &amp; Image Title.</strong>
  <strong>Sitemap URL</strong></p>
  
  <blockquote>
    <p><code>view-source:http://getintoblog.com/post-sitemap.xml</code></p>
  </blockquote>
  
  <p><strong>Kindly Help.</strong></p>