I am using an API that give me a XML response (with Curl) I need to parse the response to get a specific value
I follow the php documentation
<?php
$string = <<<XML
<?xml version='1.0'?>
<document>
<title>Forty What?</title>
<from>Joe</from>
<to>Jane</to>
<body>
I know that's the answer -- but what's the question?
</body>
</document>
XML;
$xml = simplexml_load_string($string);
print_r($xml);
?>
But in my case, the response of the curl is something like this without <<<XML XML; tag and simplexml_load_string give me empty object
`
<?xml version='1.0'?>
<document>
<title>Forty What?</title>
<from>Joe</from>
<to>Jane</to>
<body>
I know that's the answer -- but what's the question?
</body>
</document>`;
In fact, how I can surround my response with this tag ?