function generateSitemap()
 {
     jimport('joomla.html.parameter');
     $db =& JFactory::getDBO();
     $doc =& JFactory::getDocument();
     //load the style
     $doc->addStyleSheet(JURI::root(true) . '/components/com_rsseo/style.css');
     //get selected menus
     $db->setQuery("SELECT ConfigValue FROM #__rsseo_config WHERE ConfigName = 'sitemap_menus' ");
     $menus = $db->loadResult();
     //get excluded items
     $db->setQuery("SELECT ConfigValue FROM #__rsseo_config WHERE ConfigName = 'sitemap_excludes' ");
     $excludes = $db->loadResult();
     if (empty($menus)) {
         return '';
     }
     $menus = explode(',', $menus);
     $return = '';
     if (!empty($menus)) {
         foreach ($menus as $menu) {
             $params = new JParameter('');
             $params->set('menutype', $menu);
             $params->set('ignore', $excludes);
             $html = rsseoHelper::render($params, 'rsseoCallback');
             if (empty($html)) {
                 continue;
             }
             $db->setQuery("SELECT title FROM #__menu_types WHERE menutype = '" . $db->getEscaped($menu) . "'");
             $title = $db->loadResult();
             $return .= '<div class="rsseo_title">' . $title . '</div>';
             $return .= $html;
         }
     }
     return $return;
 }