I have to admit that I haven't found a faster solution. removeAttribute() just takes to much time. So perhaps the serializer should be "fixed". This would mean a slow down for Internet Explorer on html(), but this seems ok for me, as this is a Internet Explorer bug.
That's absolutely a possibility - could you add that as a comment to the bug? I could definitely work with that as a valid solution.
Something different: merge() uses "for ( var i = 0; second[i]; i++ )" for loops, all other cases where such a loop was used, it's like "for ( var i = 0, fl = first.length; i < fl; i++ )". If the way merge() does it work a few bits could be saved.
This is due to the fact that, when matching a NodeSet, in Internet Explorer and Opera, elements with an id of 'length' replace the length property, making it impossible to iterate through the set. This is one alternative to iterating through that is slightly slower (but at least it works properly). --John