replaceWith on XML problem
问题 After examining the jQuery source, I see that the problem I am having is because replaceWith calls html which does not exist for XML documents. Is replaceWith not supposed to work on XML documents? I have found this admittedly simple workaround, in case anybody needs it in the future, that will accomplish what I'm trying to do: xml.find('b').each(function() { $(this).replaceWith($('<c>yo</c>')) // this way you can custom taylor the XML based on each node's attributes and such }); But I would