Here you can find the source of removeNode(Node node)
public static void removeNode(Node node)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); you may not import org.w3c.dom.Node; public class Main { /** Removes a node from its tree. */ public static void removeNode(Node node) { node.getParentNode().removeChild(node); }//from w ww. j a va 2 s. com }