import org.w3c.dom.Document;
import org.w3c.dom.Element;
publicclass Utils {
/**
* Add a new element to the given parent
* @param parent the parent Element
* @param name the child name
* @return new Element
*/
publicstatic Element createElement(Element parent, String name) {
Document document;
Element element;
document = parent.getOwnerDocument();
element = document.createElement(name);
parent.appendChild(element);
return element;
}
}