This week's book giveaway is in the Other Languages forum. We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line! See this thread for details.
Well, you get a reference to the node you want to remove, then you get a reference to its parent, then you call parent.removeNode(child). Don't forget, that just changes your DOM. It doesn't change the original document from which you created the DOM. So you have to serialize the DOM back to a file.