I’ve got an array that is constructed as follows:
$data = array('Artists' => array(
array(...artist data...),
array(...artist data...)
);
Unfortunatey, when using XmlWriter to convert this array to XML, I’m given an block of XML that looks like this:
<root>
<Artists>
<artist>
...
</artist>
</Artists>
<artist>
...
</artist>
</root>
The problem is that XmlWriter::StartElement() will not accept an integer value for a key, so the remaining items in that part of the array are shifted back under the root element, producing a malformed document.
SimpleXMLworks great for your use.