I\'m building a script which has to patch XML files, including replacing one list of elements with another. The following function applies a patch (involving a possibly empt
parent.removeChild(node) is throwing a NOT_FOUND_ERR because node is not a child of parent. I see that node comes from getElementsByTagName which might not be an immediate child of parent. It could be anywhere under parent.