Java tutorial
//package com.java2s; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Text; public class Main { public static Element writeBooleanElement(Document document, String name, boolean value, Element parentElement) { Element element = document.createElement(name); Text text = document.createTextNode(Boolean.toString(value)); element.appendChild(text); parentElement.appendChild(element); return element; } }