Bug 986913 - Using setAttributeNS can cause serialisation to fail. r=smaug