Мне нужен текст этого xml-файла, чтобы использовать его в телеграмме, если xml поставляется без «id» и «name», я могу это сделать, но нет с тегами
<root>
<origen>...</origen>
<trend>
<zone id="809" name="AGi">
<subzone id="809" name="AGi">
<text>
I want this text.
</text>
</subzone>
</zone>
</trend>
function getIdTEXT($chatId){
$context = stream_context_create(array('http' => array('header' => 'Accept: application/xml')));
$url = "http://www.thexmlfile/MM.xml";
$xmlstring = file_get_contents($url, false, $context);
$xml = simplexml_load_string($xmlstring, "SimpleXMLElement", LIBXML_NOCDATA);
$json = json_encode($xml);
$array = json_decode($json, TRUE);
$info = "information: ".$array['trend']['zona id="809" nama="AGi"']['subzone id="809" nombre="AGi"']['text'];
sendMessage($chatId, $info);
}