Here you can find the source of AddChild(Element parent, String nodename)
public static Element AddChild(Element parent, String nodename)
//package com.java2s; // under the terms of the GNU General Public License as published by the import org.w3c.dom.*; public class Main { public static Element AddChild(Element parent, String nodename) { Element childnode = parent.getOwnerDocument().createElement(nodename); parent.appendChild(childnode);//from w w w .ja v a2 s . co m return childnode; } }