How do I prevent jQuery from inserting the 'xmlns' attribute in an XML object?

try to use

$(myXml).find('three').append('<five>some value</five>');

What happens is that the node you are inserting has another namespaceURI property.

Node derived from $.parseXML

$($.parseXML('<node/>'))[0].namespaceURI
// null

Your created node

$('<node>')[0].namespaceURI
// "http://www.w3.org/1999/xhtml"

You want your created node to also have a namespaceURI of the value null.

To make the created node inherit the namespace using jQuery, supply the original node as second argument to $() like $('<five>some value</five>', myXml).

var myXml = "<one attr='a'><two attr='b'/><three attr='c'><four attr='d'/></three></one>";
myXml = $.parseXML(myXml);
$(myXml).find('three').append($('<five>some value</five>', myXml));