public function outputMemory($flush = false)
    {
        // Beautify the XML output
        if ($this->formatOutput === true) {
            $dom = new \DOMDocument;
            $dom->formatOutput = true;
            $dom->loadXML(parent::outputMemory($flush));
            return $dom->saveXML();
        } else {
            return parent::outputMemory($flush);
        }
    }