I think that Safari probably has the more spec-compliant implementation but I report this for the sake of cross-browser AJAX compatibility.
appendChild, insertBefore, replaceChild, and setAttributeNode (could there be more?) fail when the argument is a node from a different XML document. In IE and Fx these methods behave as though the nodes are in the same document. No special logic is necessary to test whether the ownerDocument property of the two nodes is the same.
The work around is to use importNode(), call one of the above methods passing in the imported node, and remove the argument node from its parent node in the other document.
Our behavior is more spec-compliant. We would consider changing it, but I think Firefox at least is considering changing to match the spec more closely instead
Created attachment 27689 [details]
On this test case, WebKit and IE7 raise an exception, while Firefox 3.1b2 and Opera 9.63 do not. I'm not sure if that's the case reported here.
See also: bug 4569.
I don't think this is a bug. You should use importNode if you want to add a node from one document to another according to W3C specs.
Mass moving XML DOM bugs to the "DOM" Component.