title: PHP Converting from XML to JSON with a SimpleXML object. Array with <items> tag causing issues
body: <p>We are using SimpleXML to try and convert XML to JSON, and in turn convert to a PHP object, so that we can compare out Soap API with our Rest API. We have a request that returns quite a lot of data, but the part in question is where we have a nested array.</p>
  
  <p>The array is returned with the  tag in XML, however we do not want this translated into the JSON.</p>
  
  <p>The XML that we get is as follows:</p>
  
  <pre><code>                  &lt;apns&gt;
                       &lt;item&gt;
                          &lt;apn&gt;apn&lt;/apn&gt;
                       &lt;/item&gt;
                    &lt;/apns&gt;
  </code></pre>
  
  <p>So when it is translated into JSON it looks like this:</p>
  
  <p><code>{"apns":{"item":{"apn":"apn"}}</code></p>
  
  <p>In reality, we want SimpleXML to convert to the same JSON as in our Rest API, which looks like the following:</p>
  
  <p><code>{"apns":[{"apn":"apn"}]}</code></p>
  
  <p>The array could contain more than one thing, for example:</p>
  
  <pre><code>                  &lt;apns&gt;
                       &lt;item&gt;
                          &lt;apn&gt;apn&lt;/apn&gt;
                       &lt;/item&gt;
                       &lt;item&gt;
                          &lt;apn&gt;apn2&lt;/apn&gt;
                       &lt;/item&gt;
                    &lt;/apns&gt;
  </code></pre>
  
  <p>Which I'm assuming will just error in JSON or have the first one overwritten.</p>
  
  <p>I'd expect SimpleXML to be able to handle this natively, but if not has anyone got a fix that doesn't involve janky string manipulation?</p>
  
  <p>TIA :)</p>