Here you can find the source of appendElementNS(Element parent, String namespaceURI, String localName)
public static Element appendElementNS(Element parent, String namespaceURI, String localName)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); you may not import org.w3c.dom.Element; public class Main { /** Appends a new empty child element with the given namespace and name. */ public static Element appendElementNS(Element parent, String namespaceURI, String localName) { Element ret = parent.getOwnerDocument().createElementNS(namespaceURI, localName); parent.appendChild(ret);//from ww w . j a v a2 s . c om return ret; } }