Java tutorial
//package com.java2s; import org.w3c.dom.Element; public class Main { public static void setBooleanAttribute(Element el, String attr, boolean value) { el.setAttribute(attr, Boolean.toString(value)); } }