protected function renderMetaTags(array $metaTags)
    {
        $ret = array();

        $isXhtml = $this->isXhtml();

        foreach ($metaTags as $metaTag) {
            $tag = $metaTag['tag'];

            $attributes = array();

            foreach ($metaTag['attributes'] as $key => $value) {
                $attributes[] = $key . '="' . htmlspecialchars($value) . '"';
            }

            if ($isXhtml) {
                $ret[] = '<' . $tag . ' ' . implode(' ', $attributes) . '/>';
            } else {
                $ret[] = '<' . $tag . ' ' . implode(' ', $attributes) . '>';
            }
        }

        $separator = "\n";

        return $separator . implode($separator, $ret) . $separator;
    }