Java examples for XML:DOM Element Create
create Element and set tag name
//package com.java2s; 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);//from ww w . j a v a 2 s . c o m return tag; } }