protected function tidy_xml($xml)
{
if (!DEBUG) {
return $xml;
}
// Tidy configuration -- make xml readable
if (class_exists('tidy', false)) {
$config = array('indent' => true, 'output-xml' => true, 'input-xml' => true, 'wrap' => 200);
$tidy = new \tidy();
$tidy->parseString($xml, $config, 'utf8');
$tidy->cleanRepair();
$xml = $tidy;
}
return $xml;
}