Here you can find the source of removeChildren(Node e)
public static void removeChildren(Node e)
//package com.java2s; import org.w3c.dom.*; public class Main { public static void removeChildren(Node e) { NodeList list = e.getChildNodes(); for (int i = 0; i < list.getLength(); i++) { Node n = list.item(i); e.removeChild(n);/*w ww . ja v a2 s .c o m*/ } } }