Here you can find the source of removeAllChildren(Element deps)
public static void removeAllChildren(Element deps)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static void removeAllChildren(Element deps) { NodeList childNodes = deps.getChildNodes(); for (int i = childNodes.getLength() - 1; i >= 0; i--) { Node item = childNodes.item(i); deps.removeChild(item);// w w w . j a v a 2 s. c o m } } }