title: Parsing XML in PHP returns SimpleXMLElement Object. What next?
body: <p>Below is the response I get when I try to parse the XML code returned from Library of Congress SRU Service for a book search.  How do I look into  <strong>[recordData] => SimpleXMLElement Object</strong> to get the title, creator, publisher information?  This is the first time I am delving into XML.  Any help would be greatly appreciated. Here is the response I get.  I found code to deal with the name spaces, however cannot figure out how to get beyond the recordData tag.</p>
  
  <pre><code>SimpleXMLElement Object
          (
              [version] =&gt; 1.1
              [numberOfRecords] =&gt; 1
              [records] =&gt; SimpleXMLElement Object
                  (
                      [record] =&gt; SimpleXMLElement Object
                          (
                              [recordSchema] =&gt; info:srw/schema/1/dc-v1.1
                              [recordPacking] =&gt; xml
                              [recordData] =&gt; SimpleXMLElement Object
                                  (
                                  )
  
                              [recordPosition] =&gt; 1
                          )
  
                  )
  
  
          $entry=simplexml_load_file('xml_data.xml');
          $namespaces = $entry-&gt;getNameSpaces(true);
          $yr = $entry-&gt;children($namespaces['zs']); 
          print_r($yr);
  
  
          &lt;zs:searchRetrieveResponse xmlns:zs="http://www.loc.gov/zing/srw/"&gt;
          &lt;zs:version&gt;1.1&lt;/zs:version&gt;
          &lt;zs:numberOfRecords&gt;1&lt;/zs:numberOfRecords&gt;
          &lt;zs:records&gt;
          &lt;zs:record&gt;
          &lt;zs:recordSchema&gt;info:srw/schema/1/dc-v1.1&lt;/zs:recordSchema&gt;
          &lt;zs:recordPacking&gt;xml&lt;/zs:recordPacking&gt;
          &lt;zs:recordData&gt;
          &lt;srw_dc:dc xmlns:srw_dc="info:srw/schema/1/dc-schema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://purl.org/dc/elements/1.1/" xsi:schemaLocation="info:srw/schema/1/dc-schema http://www.loc.gov/standards/sru/resources/dc-schema.xsd"&gt;
          &lt;title&gt;My life /&lt;/title&gt;
          &lt;creator&gt;Clinton, Bill, 1946-&lt;/creator&gt;
          &lt;type&gt;text&lt;/type&gt;
          &lt;publisher&gt;New York : Knopf,&lt;/publisher&gt;
          &lt;date&gt;2004.&lt;/date&gt;
          &lt;language&gt;eng&lt;/language&gt;
          &lt;description&gt;Includes index.&lt;/description&gt;
          &lt;subject&gt;Clinton, Bill, 1946-&lt;/subject&gt;
          &lt;subject&gt;Clinton, Bill, 1946---Family.&lt;/subject&gt;
          &lt;subject&gt;Clinton family.&lt;/subject&gt;
          &lt;subject&gt;Presidents--United States--Biography.&lt;/subject&gt;
          &lt;coverage&gt;United States--Politics and government--1993-2001.&lt;/coverage&gt;
          &lt;identifier&gt;
          http://www.loc.gov/catdir/samples/random051/2004107564.html
          &lt;/identifier&gt;
          &lt;identifier&gt;
          http://www.loc.gov/catdir/description/random051/2004107564.html
          &lt;/identifier&gt;
          &lt;identifier&gt;URN:ISBN:0375414576&lt;/identifier&gt;
          &lt;/srw_dc:dc&gt;
          &lt;/zs:recordData&gt;
          &lt;zs:recordPosition&gt;1&lt;/zs:recordPosition&gt;
          &lt;/zs:record&gt;
          &lt;/zs:records&gt;
          &lt;/zs:searchRetrieveResponse&gt;
  </code></pre>