- simplexml_load_string: documentation ( source)
- json_encode: documentation ( source)
<?php
$xml = <<<XML
<global>
<entity_id><![CDATA[82]]></entity_id>
<attribute_set_id><![CDATA[9]]></attribute_set_id>
<sku><![CDATA[ana_8]]></sku>
<erp>
<barcode></barcode>
<erp>
</global>
XML;
echo json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA));