<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: xml code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 21 Aug 2008 06:20:21 GMT</pubDate>
    <description>DZone Snippets: xml code</description>
    <item>
      <title>Debugging SimpleXML Objects</title>
      <link>http://snippets.dzone.com/posts/show/493</link>
      <description>AGRH@!! SimpleXML bites the big one -- you can't even var_dump it to examine the contents and the controls are terrible. Luckily, you can convert it for debugging:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;$sxml = simplexml_load_string($data);&lt;br /&gt;// .. much hate between then and now... //&lt;br /&gt;debugsxml($sxml);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function debugsxml($sxml) {&lt;br /&gt;    $dom = dom_import_simplexml($sxml);&lt;br /&gt;    printArray($dom);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function printArray($array){&lt;br /&gt;    echo '&lt;pre&gt;';&lt;br /&gt;    print_r($array);&lt;br /&gt;    echo '&lt;/pre&gt;';&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;</description>
      <pubDate>Sat, 23 Jul 2005 04:59:27 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/493</guid>
      <author>ahoyhere (Amy Hoy)</author>
    </item>
  </channel>
</rss>
