public ContentResult ProductGroups() { StringBuilder sb = new StringBuilder(); sb.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); sb.Append("<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">"); foreach (var item in Groups.GetByGroupType(GroupType.Products)) { var isExists = DataLayer.Products.ExistsByGroupID(item.ID); if (isExists) { var lastestDate = DataLayer.Products.LatestDateByGroupID(item.ID); sb.AppendLine(" <url>"); sb.AppendLine(" <loc>" + StaticValues.WebsiteUrl + UrlProvider.GetGroupUrl(item.UrlPerfix) + "</loc>"); sb.AppendLine(" <lastmod>" + lastestDate.ToString("yyyy-MM-dd") + "</lastmod>"); sb.AppendLine(" </url> "); } } sb.Append("</urlset>"); return(Content(sb.ToString(), "text/xml")); }