#5762: fix handling of empty namespace in minidom, which would result in AttributeError on toxml().
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py
index d9d3be4..97668d3 100644
--- a/Lib/test/test_minidom.py
+++ b/Lib/test/test_minidom.py
@@ -1489,6 +1489,13 @@
         doc.appendChild(doc.createComment("foo--bar"))
         self.assertRaises(ValueError, doc.toxml)
 
+    def testEmptyXMLNSValue(self):
+        doc = parseString("<element xmlns=''>\n"
+                          "<foo/>\n</element>")
+        doc2 = parseString(doc.toxml())
+        self.confirm(doc2.namespaceURI == xml.dom.EMPTY_NAMESPACE)
+
+
 def test_main():
     run_unittest(MinidomTest)