minidom: access attribute value before printing it
         correct order of constructor args in createAttributeNS
pulldom: use symbolic names for uri and localnames
         correct usage of createAttribute and setAttributeNode signatures.
diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py
index 80771ad..7d610c6 100644
--- a/Lib/xml/dom/minidom.py
+++ b/Lib/xml/dom/minidom.py
@@ -331,7 +331,7 @@
 
         for a_name in a_names:
             writer.write(" %s=\"" % a_name)
-            _write_data(writer, self._get_attributes()[a_name])
+            _write_data(writer, self._get_attributes()[a_name].value)
             writer.write("\"")
         if self.childNodes:
             writer.write(">")
@@ -429,7 +429,7 @@
 
     def createAttributeNS(self, namespaceURI, qualifiedName):
         prefix,localName = _nssplit(qualifiedName)
-        return Attr(namespaceURI, qualifiedName, localName, prefix)
+        return Attr(qualifiedName, namespaceURI, localName, prefix)
 
     def getElementsByTagNameNS(self, namespaceURI, localName):
         _getElementsByTagNameNSHelper(self, namespaceURI, localName)