The value returned is a reference to the node that was removed. The same rules used for the getNamedItem() method apply. If no item is found then a null is returned instead. Multiple matching nodes may result in unpredictable and implementation specific results.
If this node is not referred to by any other means and you do not assign the value to a variable, then the node will become detached and no longer has an owner. You will have no way to locate that node again without reconstructing the document. The object representing the node should in due course be garbage collected automatically.