final public static function redirect($link, $render = true)
    {
        self::$domDocument = new \DOMDocument('1.0', 'utf-8');
        self::$parentNodes = array();
        self::$parentLayouts = array();

        $redirect = self::$domDocument->createElement('redirect');
        $redirect->appendChild(self::$domDocument->createTextNode($link));
        self::$domDocument->appendChild($redirect);
        self::$parentNodes[] = $redirect;

        if ($render) {
            if (ob_get_contents()) {
                ob_clean();
            }
            header('Content-Type: text/xml; charset=utf-8');
            echo self::$domDocument->saveXML();
        } else {
            return self::$domDocument->saveXML();
        }
    }