Here you can find the source of removeNodeFromParent(Node node)
public static void removeNodeFromParent(Node node)
//package com.java2s; //License from project: Apache License import org.w3c.dom.Node; public class Main { public static void removeNodeFromParent(Node node) { Node parent = node.getParentNode(); parent.removeChild(node);//from w ww.j av a2 s .c o m } }