Index: /qPloneGoogleSitemaps/branches/contenttype/browser/configure.zcml
===================================================================
--- /qPloneGoogleSitemaps/branches/contenttype/browser/configure.zcml	(revision 394)
+++ /qPloneGoogleSitemaps/branches/contenttype/browser/configure.zcml	(revision 395)
@@ -6,3 +6,13 @@
     <!-- -*- extra stuff goes here -*- -->
 
+    <browser:page
+      for="..interfaces.ISitemap"
+      name="sitemap.xml"
+      class=".sitemapview.SitemapView"
+      template="templates/sitemapview.pt"
+      allowed_interface=".sitemapview.ISitemapView"
+      permission="zope.Public"
+    />
+
+
 </configure>
Index: /qPloneGoogleSitemaps/branches/contenttype/browser/sitemapview.py
===================================================================
--- /qPloneGoogleSitemaps/branches/contenttype/browser/sitemapview.py	(revision 395)
+++ /qPloneGoogleSitemaps/branches/contenttype/browser/sitemapview.py	(revision 395)
@@ -0,0 +1,79 @@
+from string import find
+from zope.interface import implements, Interface
+
+from Products.Five import BrowserView
+from Products.CMFCore.utils import getToolByName
+
+from Products.qPloneGoogleSitemaps import qPloneGoogleSitemapsMessageFactory as _
+from utils import additionalURLs, applyOperations
+
+
+class ISitemapView(Interface):
+    """
+    Sitemap view interface
+    """
+
+    def test():
+        """ test method"""
+
+
+class SitemapView(BrowserView):
+    """
+    Sitemap browser view
+    """
+    implements(ISitemapView)
+
+    def __init__(self, context, request):
+        self.context = context
+        self.request = request
+
+    @property
+    def portal_catalog(self):
+        return getToolByName(self.context, 'portal_catalog')
+
+    @property
+    def portal(self):
+        return getToolByName(self.context, 'portal_url').getPortalObject()
+
+    def test(self):
+        """
+        test method
+        """
+        dummy = _(u'a dummy string')
+
+        return {'dummy': dummy}
+
+    def results(self, path=None):
+        if not path:
+            portal = getToolByName(self.context, 'portal_url')
+            path = portal.getPortalPath()
+
+        portal_types = self.context.getPortalTypes()
+        review_states = self.context.getStates()
+        catalog = getToolByName(self.context, 'portal_catalog')
+        try:
+            objects = catalog(path = path,
+                portal_type = portal_types,
+                review_state = review_states,)
+        except AttributeError:
+            # We are run without being properly installed, do default processing
+            return applyOperations(catalog(path = path,
+                review_state = ['published'],), [])
+
+        blackout_list = self.context.getBlackout_list()
+        reg_exps = self.context.getReg_exp()
+        return applyOperations([ob for ob in objects 
+            if (ob.getId not in blackout_list)],
+            reg_exps)
+
+    def updateRequest(self):
+        self.request.RESPONSE.setHeader('Content-Type', 'text/xml')
+        try:
+            compression = self.context.enableHTTPCompression()
+            if compression:
+                compression(request=self.request)
+        except:
+            pass
+
+    def getAdditionalURLs(self):
+        return additionalURLs(self.context)
Index: /qPloneGoogleSitemaps/branches/contenttype/browser/templates/sitemapview.pt
===================================================================
--- /qPloneGoogleSitemaps/branches/contenttype/browser/templates/sitemapview.pt	(revision 395)
+++ /qPloneGoogleSitemaps/branches/contenttype/browser/templates/sitemapview.pt	(revision 395)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<urlset xmlns="http://www.google.com/schemas/sitemap/0.9"
+        xmlns:tal="http://xml.zope.org/namespaces/tal"
+        xmlns:metal="http://xml.zope.org/namespaces/metal"
+        tal:define="results view/results;
+                    dummy view/updateRequest;">
+  <url tal:condition="results"
+       tal:repeat="result results">
+    <loc tal:content="result/url">http://www.yoursite.com/</loc>
+    <lastmod tal:content="result/modification_date">2005-01-01</lastmod>
+  </url>
+  <url tal:define="URLs view/getAdditionalURLs"
+       tal:condition="URLs"
+       tal:repeat="URL URLs">
+    <loc tal:content="URL">http://www.yoursite.com/</loc>
+  </url>
+</urlset>
Index: /qPloneGoogleSitemaps/branches/contenttype/browser/utils.py
===================================================================
--- /qPloneGoogleSitemaps/branches/contenttype/browser/utils.py	(revision 395)
+++ /qPloneGoogleSitemaps/branches/contenttype/browser/utils.py	(revision 395)
@@ -0,0 +1,53 @@
+import re
+
+from DateTime import DateTime
+
+from Products.CMFCore.utils import getToolByName
+import Products.qPloneGoogleSitemaps.config as config
+
+ADD_ZOPE = re.compile('^/')
+ADD_PLONE = re.compile('^[^http://|https://|\\\]')
+OPERATIONS_PARSE = re.compile(r"(.?[^\\])/(.*[^\\]|)/(.*[^\\]|)/")
+
+def searchAndReplace(string, what, with):
+    """Emulate sed command s/"""
+    res = re.sub(what,with,string)
+    return res
+OPERATORS = {'s': searchAndReplace,}
+
+def applyOperations(objects, operations):
+    """Parse Operations """
+    operations=[OPERATIONS_PARSE.match(op).groups() for op in operations]
+    result, urls = [],[]
+    for ob in objects:
+        url = ob.getURL()
+        for operator, what, with in operations:
+            url = OPERATORS[operator](url, what, with.replace("\\", ""))
+        #TODO: Remove or replace following condition
+        #it is senseless in the case we need intelligent
+        #result set. Better condition would be to place
+        #freshest brain into result
+        if url in urls:
+            continue
+        urls.append(url)
+        result.append({'url' : url,
+                       'modification_date' : DateTime(ob.ModificationDate).HTML4()
+                       })
+    return result
+
+def additionalURLs(context):
+    """Add URLs to sitemap that arn't objects"""
+    res = []
+
+    plone_home = getToolByName(context, 'portal_url')()
+    root = context.getPhysicalRoot().absolute_url()
+    URLs =  context.getUrls()
+
+    for url in URLs:
+        if ADD_ZOPE.match(url):
+            res.append(root+url)
+        elif ADD_PLONE.match(url):
+            res.append(plone_home+'/'+url)
+        else:
+            res.append(url)
+    return res
Index: /qPloneGoogleSitemaps/branches/contenttype/profiles/default/types/Sitemap.xml
===================================================================
--- /qPloneGoogleSitemaps/branches/contenttype/profiles/default/types/Sitemap.xml	(revision 394)
+++ /qPloneGoogleSitemaps/branches/contenttype/profiles/default/types/Sitemap.xml	(revision 395)
@@ -13,6 +13,7 @@
   <property name="filter_content_types">False</property>
   <property name="allow_discussion">False</property>
-  <property name="default_view">base_view</property>
+  <property name="default_view">sitemap.xml</property>
   <property name="view_methods">
+    <element value="sitemap.xml" />
     <element value="base_view" />
   </property>
