Jenže já to dostávám jako text, ne array.
Vyřešil jsem to zatím takhle:
private function ParseXML($text) {
$replace = array("[\n [","]\n]" , "{","}","children: [\n [","]\n ]", "," ,"\"");
$with = array("<list>","</list>","<item>","</item>","<sublist>","</sublist>",null,null);
$xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
$xml.= str_replace($replace,$with,$text);
$xml = preg_replace("/name:(.*)/", "<name>$1</name>", $xml);
$xml = preg_replace("/id:(.*)/", "<id>$1</id>", $xml);
return $xml;
}