Here you can find the source of createElement(Element parent, String tagName)
static public Element createElement(Element parent, String tagName)
//package com.java2s; //License from project: Apache License import org.w3c.dom.Element; public class Main { static public Element createElement(Element parent, String tagName) { Element tag = parent.getOwnerDocument().createElement(tagName); parent.appendChild(tag);/* w w w .j a va 2 s. c o m*/ return tag; } }