Java tutorial
//package com.java2s; import org.w3c.dom.Document; import org.w3c.dom.Attr; public class Main { public static Attr getActionTypeAttribute(Document doc, String attrName, String action) { Attr attr_action_type = doc.createAttribute(attrName); attr_action_type.setValue(action); return attr_action_type; } }