See the test case provided. Here is the javascript code that reproduces the problem. <script type="text/javascript"> var domDoc = (new DOMParser()).parseFromString("<test><element attr1=\"test\" attr2=\"\" attr3=\"something\" /></test>", "text/xml"); var xmlSerializer = new XMLSerializer(); var serializedXML = xmlSerializer.serializeToString(domDoc); document.write("<textarea cols='60' rows='5'>" + serializedXML + "</textarea>"); var element = domDoc.getElementsByTagName('element')[0]; attr = element.getAttributeNode('attr1'); var serializedXML = xmlSerializer.serializeToString(domDoc); document.write("<textarea cols='60' rows='5'>" + serializedXML + "</textarea>"); document.write("<br/>Node value: "+ element.getAttributeNode('attr1').nodeValue); </script> The second textarea shows that the value for the attr1 attribute is lost in the serialization. The DOM is still correct because the value can still be accessed. If the call to getAttributeNode is removed, the second serialization works fine.
I can reproduce this issue with stock 10.4.7 Safari, but not with a recent nightly (r15780). You can get a nightly build to verify the behavior from <http://nightly.webkit.org>. Not sure what exactly fixed this, so closing as WORKSFORME.
Mass moving XML DOM bugs to the "DOM" Component.