public function detectMainTemplate()
    {
        $name = (isset($this->mainxsl) && !empty($this->mainxsl)) ? $this->mainxsl : 'index';

        foreach ($this->getIncludePaths() as $path) {
            if (is_readable($path.DIRECTORY_SEPARATOR.$name.'.xsl')) {
                $this->xsl->includeXSL($path.DIRECTORY_SEPARATOR.$name.'.xsl', true);

                return $path.DIRECTORY_SEPARATOR.$name.'.xsl';
            }
        }
    }