public function generateFromArray(array $data)
    {
        $xml = $this->processGenerate($this->rootName, $data);
        $this->createPiNode();
        $this->getDomDocument()->appendChild($xml);
        $xml = $this->getDomDocument()->saveXML();

        $this->flush();

        return $xml;
    }