Here you can find the source of createAttribute(Document document, String name, String value)
public static Attr createAttribute(Document document, String name, String value)
//package com.java2s; /*//w ww .ja va2 s . c o m * JFox - The most lightweight Java EE Application Server! * more details please visit http://www.huihoo.org/jfox or http://www.jfox.org.cn. * * JFox is licenced and re-distributable under GNU LGPL. */ import org.w3c.dom.Attr; import org.w3c.dom.Document; public class Main { public static Attr createAttribute(Document document, String name, String value) { Attr attr = document.createAttribute(name); attr.setTextContent(value); return attr; } }