protected function parseXML($response)
{
if ($response != '') {
libxml_clear_errors();
libxml_use_internal_errors(true);
$xml = simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA);
if (libxml_get_errors()) {
$msg = var_export(libxml_get_errors(), true);
libxml_clear_errors();
throw new PrestaShopWebserviceException('HTTP XML response is not parsable: ' . $msg);
}
return $xml;
} else {
throw new PrestaShopWebserviceException('HTTP response is empty');
}
}