append XML Element Child - Java XML

Java examples for XML:XML Element Child

Description

append XML Element Child

Demo Code


//package com.java2s;
import org.w3c.dom.*;

public class Main {
    public static Element appendElementChild(Document doc, Element parent,
            String name) {/*from w  w w.  j  a va2 s.c  o m*/
        Element el = doc.createElement(name);
        parent.appendChild(el);
        return el;
    }
}

Related Tutorials