Fix NullPointerException resulting from incorrect namespace comparison

This comparison should use the attribute prefix instead of the element prefix, and omit the default XML namespace from the generated namespace list. The current implementation throws a NullPointerException when a new element with an xml: prefixed attribute is inserted into the DOM.