Here you can find the source of addChildElement(Element element, String childElementName, Document document)
public static Element addChildElement(Element element, String childElementName, Document document)
//package com.java2s; /*/* w w w . j a va2 s . c o m*/ * XMLUtils.java * * Copyright (c) 1998 - 2006 BusinessTechnology, Ltd. * All rights reserved * * This program is the proprietary and confidential information * of BusinessTechnology, Ltd. and may be used and disclosed only * as authorized in a license agreement authorizing and * controlling such use and disclosure * * Millennium ERP system. * */ import org.w3c.dom.Document; import org.w3c.dom.Element; public class Main { /** * Creates a child element with the given name and appends it to the element child node list. */ public static Element addChildElement(Element element, String childElementName, Document document) { Element newElement = document.createElement(childElementName); element.appendChild(newElement); return newElement; } }