Here you can find the source of createChild(Element el, String name, boolean attach)
public static Element createChild(Element el, String name, boolean attach)
//package com.java2s; import org.w3c.dom.*; public class Main { /**/* ww w.ja va 2s. co m*/ * Creates a child element with the given name beneath the specified element. */ public static Element createChild(Element el, String name) { return createChild(el, name, true); } /** * Creates an element with the given name in the specified element's DOM, * inserting it into the tree structure as a child of that element * if the attach flag is set. */ public static Element createChild(Element el, String name, boolean attach) { Element child = el.getOwnerDocument().createElement(name); if (attach) el.appendChild(child); return child; } }