public function render($echo = false)
    {
        $domDocument                = new \DOMDocument("1.0", "utf-8");
        $domDocument->xmlStandalone = true;

        $domElement = $domDocument->createElement("maniacode");
        $domDocument->appendChild($domElement);

        if ($this->disableConfirmation) {
            $domElement->setAttribute("noconfirmation", 1);
        }

        foreach ($this->elements as $element) {
            $childDomElement = $element->render($domDocument);
            $domElement->appendChild($childDomElement);
        }

        if ($echo) {
            header("Content-Type: application/xml; charset=utf-8;");
            echo $domDocument->saveXML();
        }

        return $domDocument;
    }