Replacing a node with nothing will remove the element but preserve the elements content. And another function which will remove a matching node and all of its children