public function render()
    {
        $html = new Text();
        $html
            ->append('<')
            ->append($this->getName());

        foreach ($this->attributes as $name => $value) {
            $html->append(' ')
                ->append($name)
                ->append('=')
                ->append('"')
                ->append($value)
                ->append('"');
        }

        if ($this->text->isEmpty()) {
            if ($this->type == self::TYPE_BLOCK) {
                return (string)$html->append('>')->append('</')->append($this->getName())->append('>');
            } else {
                return (string)$html->append($this->emptyTagSuffix);
            }
        }

        return (string)$html
            ->append('>')
            ->append($this->text)
            ->append('</')
            ->append($this->getName())
            ->append('>');
    }