Here you can find the source of createXmlElement(Document xml, Element parent, String name)
public static final Element createXmlElement(Document xml, Element parent, String name)
//package com.java2s; import org.w3c.dom.Document; import org.w3c.dom.Element; public class Main { public static final Element createXmlElement(Document xml, Element parent, String name) { Element e = xml.createElement(name); try {// w w w . ja v a 2 s. c o m parent.appendChild(e); } catch (Exception ex) { System.out.println(ex.toString()); } return e; } }