Index: docs/ref/contrib/sitemaps.txt
===================================================================
--- docs/ref/contrib/sitemaps.txt	(revision 16338)
+++ docs/ref/contrib/sitemaps.txt	(working copy)
@@ -312,7 +312,13 @@
             'template_name': 'custom_sitemap.html'
         }),
     )
+    
+.. versionadded:: 1.4
 
+In addition, these views also return :class:`~django.template.response.TemplateResponse` 
+instances which allow you to easily customize the response data before rendering. 
+For more details, see the :doc:`TemplateResponse documentation </ref/template-response>`. 
+
 Pinging Google
 ==============
 
Index: django/contrib/sitemaps/views.py
===================================================================
--- django/contrib/sitemaps/views.py	(revision 16338)
+++ django/contrib/sitemaps/views.py	(working copy)
@@ -1,9 +1,9 @@
 from django.http import HttpResponse, Http404
-from django.template import loader
 from django.contrib.sites.models import get_current_site
 from django.core import urlresolvers
 from django.utils.encoding import smart_str
 from django.core.paginator import EmptyPage, PageNotAnInteger
+from django.template.response import TemplateResponse
 
 def index(request, sitemaps, template_name='sitemap_index.xml'):
     current_site = get_current_site(request)
@@ -20,8 +20,7 @@
         if pages > 1:
             for page in range(2, pages+1):
                 sites.append('%s://%s%s?p=%s' % (protocol, current_site.domain, sitemap_url, page))
-    xml = loader.render_to_string(template_name, {'sitemaps': sites})
-    return HttpResponse(xml, mimetype='application/xml')
+    return TemplateResponse(request, template_name, {'sitemaps': sites}, mimetype='application/xml')
 
 def sitemap(request, sitemaps, section=None, template_name='sitemap.xml'):
     maps, urls = [], []
@@ -43,5 +42,4 @@
             raise Http404("Page %s empty" % page)
         except PageNotAnInteger:
             raise Http404("No page '%s'" % page)
-    xml = smart_str(loader.render_to_string(template_name, {'urlset': urls}))
-    return HttpResponse(xml, mimetype='application/xml')
+    return TemplateResponse(request, template_name, {'urlset': urls}, mimetype='application/xml')
