protected function compileDoctype(Node $node)
    {

        $name = $node->name;
        $value = isset($this->options['doctypes'][$name]) ? $this->options['doctypes'][$name] : '<!DOCTYPE '.$name.'>';

        if ($name === 'xml') {

            $this->options['mode'] = self::MODE_XML;

            if ($this->options['echo_xml_doctype'])
                $value = "<?='$value'?>";

        } else if (in_array($name, $this->options['xhtml_modes']))
            $this->options['mode'] = self::MODE_XHTML;
        else
            $this->options['mode'] = self::MODE_HTML;

        return $value;
    }