Here you can find the source of removeAllChildren(org.w3c.dom.Element element)
public static void removeAllChildren(org.w3c.dom.Element element)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Node; public class Main { public static void removeAllChildren(org.w3c.dom.Element element) { if (element == null) { return; }/* w ww . ja v a2s. co m*/ for (int index = 0; index < element.getChildNodes().getLength(); index++) { Node child = element.getChildNodes().item(0); element.removeChild(child); } } }