  
      def ignorableWhitespace(self, whitespace):
          self.characters(self, whitespace)
-@@ -194,6 +224,8 @@
+@@ -194,6 +210,8 @@
              except xml.sax.SAXParseException, e:
                  raise ValueError(e)
  

 import xml.dom.minidom
 import xml.sax
 
@@ -106,6 +106,26 @@
             "children"   : [],
         }]
 

+        # multiple times in a document.
+        self.unknownElementClasses = {}
+
     def endDocument(self):
         top = self.stack[-1]
 
@@ -115,6 +121,7 @@
         assert len(top["children"]) is 1, "Must have exactly one root element, got %d" % len(top["children"])
 
         self.dom = WebDAVDocument(top["children"][0])
+        del(self.unknownElementClasses)
 
     def startElementNS(self, name, qname, attributes):
         attributes_dict = {}
@@ -125,13 +132,17 @@
 
         tag_namespace, tag_name = name
 
-        if (name not in elements_by_tag_name):
-            class UnknownElement (WebDAVUnknownElement):
-                namespace = tag_namespace
-                name      = tag_name
-            element_class = UnknownElement
+        if name in elements_by_tag_name:
+            element_class = elements_by_tag_name[name]
+        elif name in self.unknownElementClasses:
+            element_class = self.unknownElementClasses[name]
         else:
-            element_class = elements_by_tag_name[name]
+            def element_class(*args, **kwargs):
+                element = WebDAVUnknownElement(*args, **kwargs)
+                element.namespace = tag_namespace
+                element.name      = tag_name
+                return element
+            self.unknownElementClasses[name] = element_class
 
         self.stack.append({
             "name"       : name,
@@ -158,7 +169,12 @@
         self.stack[-1]["children"].append(element)
 
     def characters(self, content):
