Issue #10131: Fixed deep copying of minidom documents.  Based on patch
by Marian Ganisin.
diff --git a/Lib/xml/dom/minicompat.py b/Lib/xml/dom/minicompat.py
index de4cb4f..266a7f4 100644
--- a/Lib/xml/dom/minicompat.py
+++ b/Lib/xml/dom/minicompat.py
@@ -65,10 +65,10 @@
     length = property(_get_length, _set_length,
                       doc="The number of nodes in the NodeList.")
 
-    def __getstate__(self):
-        return list(self)
-
+    # For backward compatibility
     def __setstate__(self, state):
+        if state is None:
+            state = []
         self[:] = state