Quick question are you trying to conjoin two documents into one to parse it all on one parse as the content document is a separate one? They can be merged, and your code works fine for that as this is your example isolated.
$xml = <<<XML
<?xml version="1.0" encoding="utf-8"?>
<webRequest>
<id>160810</id>
<request>
<merchantShortName>ReServe</merchantShortName>
<serviceName>reservationManagementServices</serviceName>
<actionName>diningResListGet</actionName>
</request>
<authentication>
<username>lynn</username>
<password>lynn</password>
</authentication>
<content>
<![CDATA[<?xml version="1.0" encoding="UTF-8" ?>
<diningResListGetRequest>
<dateRangeFilter>
<fromDate>2015-10-15</fromDate>
<toDate>2015-10-15</toDate>
</dateRangeFilter>
<siteNameFilter>
<matchCriterion>EqualTo</matchCriterion>
<stringValue>Frontier Vineyards</stringValue>
</siteNameFilter>
<maxReturned>50</maxReturned>
<servicePeriodFilter>Dinner</servicePeriodFilter>
<modifiedDateTimeFilter>
<fromDateTime>2012-04-01T12:00:00</fromDateTime>
</modifiedDateTimeFilter>
</diningResListGetRequest>
]]></content>
</webRequest>
XML;
$rawXML = str_replace('<![CDATA[<?xml version="1.0" encoding="UTF-8" ?>', "", $xml);
$rawXML = str_replace(']]>', "", $rawXML);
$xml = simplexml_load_string($rawXML);
echo( $xml->saveXML() );
If I add a line space at the start of the xml I get the same error “simplexml_load_string(): Entity: line 2: parser error : XML declaration allowed only at the” so it may be work trimming the xml.
$xml = <<<XML
<?xml version="1.0" encoding="utf-8"?>
<webRequest>
<id>160810</id>
<request>
<merchantShortName>ReServe</merchantShortName>
<serviceName>reservationManagementServices</serviceName>
<actionName>diningResListGet</actionName>
</request>
<authentication>
<username>lynn</username>
<password>lynn</password>
</authentication>
<content>
<![CDATA[<?xml version="1.0" encoding="UTF-8" ?>
<diningResListGetRequest>
<dateRangeFilter>
<fromDate>2015-10-15</fromDate>
<toDate>2015-10-15</toDate>
</dateRangeFilter>
<siteNameFilter>
<matchCriterion>EqualTo</matchCriterion>
<stringValue>Frontier Vineyards</stringValue>
</siteNameFilter>
<maxReturned>50</maxReturned>
<servicePeriodFilter>Dinner</servicePeriodFilter>
<modifiedDateTimeFilter>
<fromDateTime>2012-04-01T12:00:00</fromDateTime>
</modifiedDateTimeFilter>
</diningResListGetRequest>
]]></content>
</webRequest>
XML;
$rawXML = str_replace('<![CDATA[<?xml version="1.0" encoding="UTF-8" ?>', "", $xml);
$rawXML = str_replace(']]>', "", $rawXML);
$xml = simplexml_load_string($rawXML);
echo( $xml->saveXML() );