public function endDocument($data) { $this->checkEndDocument($data); $this->xmlWriter->endDocument(); return $this->xmlWriter->outputMemory(); }