As SimpleXMLElement
always uses "\n"
to separate the XML-Declaration from the rest of the document, it can be split at that position and the remainder taken:
explode("\n", $customXML->asXML(), 2)[1];
Example:
');
echo explode("\n", $customXML->asXML(), 2)[1];
Output: