Node.js examples for DOM:Element
Using parentNode instead of parentElement it covers the document case as well.
Util.removeElement = function(element) { return element.parentNode.removeChild(element); };