public static Element createElement(Document doc,String tag,String nsURI,String prefix){
  String qName=(prefix == null || prefix.length() == 0) ? tag : prefix + ":" + tag;
  return doc.createElementNS(nsURI,qName);
}

public static Element createElement ( Document doc , String tag , String nsURI , String prefix ) { String qName = ( prefix == null || prefix . length ( ) == 0 ) ? tag : prefix + ":" + tag ; return doc . createElementNS ( nsURI , qName ) ; }
creates an element in the specified namespace , with the specified tag and namespace prefix .
