title: How to get ALL elements of simplexml object
body: <p>OK, I'm totally stumped here. I've found similar questions, but the answers don't seem to work for my specific problem. I've been working on this on and off for days.</p>
  
  <p>I have this here simplexml object (it's actually much, much, MUCH longer than this, but I'm cutting out all the extraneous stuff so you'll actually look at it):</p>
  
  <pre><code>SimpleXMLElement Object
  (
      [SubjectClassification] =&gt; Array
          (
              [0] =&gt; SimpleXMLElement Object
                  (
                      [@attributes] =&gt; Array
                          (
                              [Authority] =&gt; Category Code
                              [Value] =&gt; s
                              [Id] =&gt; s
                          )
  
                  )
  
              [1] =&gt; SimpleXMLElement Object
                  (
                      [@attributes] =&gt; Array
                          (
                              [Authority] =&gt; Subject
                              [Value] =&gt; Sports
                              [Id] =&gt; 54df6c687df7100483dedf092526b43e
                          )
  
                  )
  
              [2] =&gt; SimpleXMLElement Object
                  (
                      [@attributes] =&gt; Array
                          (
                              [Authority] =&gt; Subject
                              [Value] =&gt; Professional baseball
                              [Id] =&gt; 20dd2c287e4e100488e5d0913b2d075c
                          )
  
                  )
  
          )
  
  )
  </code></pre>
  
  <p>I got this block of code by doing a print_r on a variable containing the following:</p>
  
  <pre><code>$subjects-&gt;SubjectClassification-&gt;children();
  </code></pre>
  
  <p>Now, I want to get at all the elements of the subjectClassification array. ALL of them! But when I do this:</p>
  
  <pre><code>$subjects-&gt;SubjectClassification;
  </code></pre>
  
  <p>Or this:</p>
  
  <pre><code>$subjects-&gt;SubjectClassification-&gt;children();
  </code></pre>
  
  <p>OR if I try to get all the array elements via a loop, all I get is this:</p>
  
  <pre><code>SimpleXMLElement Object
  (
      [@attributes] =&gt; Array
          (
              [Authority] =&gt; Category Code
              [Value] =&gt; s
              [Id] =&gt; s
          )
  
  )
  </code></pre>
  
  <p>Why? How can I get everything?</p>