Index: xwiki-platform-core/xwiki-core/src/main/java/com/xpn/xwiki/XWiki.java
===================================================================
--- xwiki-platform-core/xwiki-core/src/main/java/com/xpn/xwiki/XWiki.java	(revision 9681)
+++ xwiki-platform-core/xwiki-core/src/main/java/com/xpn/xwiki/XWiki.java	(working copy)
@@ -2777,6 +2777,7 @@
     public BaseClass getGroupClass(XWikiContext context) throws XWikiException
     {
         XWikiDocument doc;
+        XWikiDocument template = null;
         boolean needsUpdate = false;
 
         try {
@@ -2800,6 +2801,22 @@
 
         if (needsUpdate)
             saveDocument(doc, context);
+        
+        // Create the group template document and attach a XWiki.XWikiGroupClass object
+        try {
+            template = getDocument("XWiki.XWikiGroupTemplate", context);
+        } catch (Exception e) {
+            template = new XWikiDocument();
+            template.setSpace("XWiki");
+            template.setName("XWikiGroupTemplate");
+        } finally {
+            if(template.isNew()) {
+                template.setContent("#includeForm(\"XWiki.XWikiGroupSheet\")");
+                template.createNewObject(bclass.getName(), context);
+                saveDocument(template, context.getMessageTool().get("core.comment.createdGroupTemplate"), context);                 
+            }
+        }
+        
         return bclass;
     }
 
Index: xwiki-platform-core/xwiki-core/src/main/resources/ApplicationResources.properties
===================================================================
--- xwiki-platform-core/xwiki-core/src/main/resources/ApplicationResources.properties	(revision 9681)
+++ xwiki-platform-core/xwiki-core/src/main/resources/ApplicationResources.properties	(working copy)
@@ -741,6 +741,7 @@
 core.comment.deleteAttachmentComment=Deletion of attachment {0}
 core.comment.deleteImageComment=Deletion of image {0}
 core.comment.renameLink=Renamed links to {0} following the rename of that page
+core.comment.createdGroupTemplate=Created Group Template
 
 core.minoredit=Is minor edit
 core.minoredit.show=Show minor edits
