public function parse($asxml = false)
    {
        $xml = new stdClass();

        // Error messages to XML
        if (isset($_SESSION['messages']) && !empty($_SESSION['messages'])) {
            $xml->messages = $_SESSION['messages'];
            unset($_SESSION['messages']);
        }

        // Page requisites
        foreach ($this->requisites as $k => $v) {
            if (is_array($v)) {
                $v = array_unique($v);
            }

            $xml->{$k} = $v;
        }

        // Properties
        foreach ($this->properties as $k => $v) {
            if (!empty($v)) {
                $xml->$k = $v;
            }
        }

        $this->addObject($xml, false, 'common');

        // Return parsed XHTML
        $module = $this->dom->createElement('module');
        $module->appendChild($this->page);
        $this->dom->firstChild->appendChild($module);

        if (error_reporting() === E_ALL) {
            Debug::__print(htmlspecialchars($this->toString()));
        }

        try {
            $retval = $this->asxml ? $this->toString() : $this->xsl->parse($this->dom);
        } catch (Exception $e) {
            Debug::__print($e->getMessage());
            $retval = false;
        }

        return $retval;
    }