protected function renderXml($data)
    {
        $xml = $this->arrayToXml($data);

        $dom = new \DOMDocument('1.0');
        $dom->preserveWhiteSpace = false;
        $dom->formatOutput = $this->pretty;
        $dom->loadXML($xml->asXML());

        return $dom->saveXML();
    }