code: public void run() throws Exception {
  
          CmsObject cms = getCmsObject();
          String seoFilePath = cms.getRequestContext().getUri();
          CmsResource seoFile = cms.readResource(seoFilePath);
          m_configuration = new CmsXmlSeoConfiguration();
          m_configuration.load(cms, seoFile);
          String mode = m_configuration.getMode();
          if (mode.equals(CmsXmlSeoConfiguration.MODE_ROBOTS_TXT)) {
              showRobotsTxt();
          } else {
              boolean updateCache = Boolean.parseBoolean(getRequest().getParameter("updateCache"));
              String value = "";
              if (updateCache && m_configuration.usesCache()) {
                  // update request, and caching is configured -> update the cache
                  CmsXmlSitemapGenerator generator = prepareSitemapGenerator(seoFile, m_configuration);
                  value = generator.renderSitemap();
                  CmsXmlSitemapCache.INSTANCE.put(seoFile.getRootPath(), value);
              } else if (!updateCache && m_configuration.usesCache()) {
                  // normal request, and caching is configured -> look in the cache first, and if not found, calculate sitemap and store it in cache
                  String cachedValue = CmsXmlSitemapCache.INSTANCE.get(seoFile.getRootPath());
                  if (cachedValue != null) {
                      value = cachedValue;
                  } else {
                      CmsXmlSitemapGenerator generator = prepareSitemapGenerator(seoFile, m_configuration);
                      value = generator.renderSitemap();
                      CmsXmlSitemapCache.INSTANCE.put(seoFile.getRootPath(), value);
                  }
              } else if (!updateCache && !m_configuration.usesCache()) {
                  // normal request, caching is not configured -> always generate a fresh sitemap
                  CmsXmlSitemapGenerator generator = prepareSitemapGenerator(seoFile, m_configuration);
                  value = generator.renderSitemap();
              } else if (updateCache && !m_configuration.usesCache()) {
                  // update request with no caching configured -> ignore
              }
              getResponse().getWriter().print(value);
          }
  
      }
docs: Displays either the generated sitemap.xml or the generated robots.txt, depending on the configuration.<p>
  
  @throws Exception if something goes wrong