Index: waeup/branches/ulif-layout/src/waeup/browser/pages.py
===================================================================
--- waeup/branches/ulif-layout/src/waeup/browser/pages.py	(revision 4778)
+++ waeup/branches/ulif-layout/src/waeup/browser/pages.py	(revision 4779)
@@ -17,5 +17,6 @@
                               IUserAccount, IFacultyContainer, IDataCenter,
                               IFaculty, IDepartment, ICourse, ICertificate,
-                              ICertificateCourse)
+                              ICertificateCourse, IWAeUPXMLImporter,
+                              IWAeUPXMLExporter)
 from waeup.widgets.interfaces import ITableProvider
 from waeup.utils.helpers import getName
@@ -28,4 +29,5 @@
 from zope.exceptions import DuplicationError
 
+grok.context(IWAeUPObject)
 grok.templatedir('templates')
 
@@ -340,4 +342,49 @@
             self.redirect(self.url(self.context))
         return
+
+class ExportXMLPage(grok.View):
+    """Deliver an XML representation of the context.
+    """
+    grok.name('export.xml')
+    grok.require('waeup.manageUniversity')
+    
+    def render(self):
+        exporter = IWAeUPXMLExporter(self.context)
+        xml = exporter.export().read()
+        self.response.setHeader(
+            'Content-Type', 'text/xml; charset=UTF-8')
+        return xml
+
+class ImportXMLPage(WAeUPPage):
+    """Replace the context object by an object created from an XML
+       representation.
+
+       XXX: This does not work for ISite objects, i.e. for instance
+            for complete University objects.
+    """
+    grok.name('importxml')
+    grok.require('waeup.manageUniversity')
+
+    def update(self, xmlfile=None, CANCEL=None, SUBMIT=None):
+        if CANCEL is not None:
+            self.redirect(self.url(self.context))
+            return
+        if not xmlfile:
+            return
+        importer = IWAeUPXMLImporter(self.context)
+        obj = importer.doImport(xmlfile)
+        if type(obj) != type(self.context):
+            return
+        parent = self.context.__parent__
+        name = self.context.__name__
+        self.context = obj
+        if hasattr(parent, name):
+            setattr(parent, name, obj)
+        else:
+            del parent[name]
+            parent[name] = obj
+            pass
+        return
+
 
 
