Here you can find the source of appendChildElementBoolean(Element parentNode, String tagName, boolean content)
public static Element appendChildElementBoolean(Element parentNode, String tagName, boolean content)
//package com.java2s; //License from project: Apache License import org.w3c.dom.*; public class Main { public static Element appendChildElementBoolean(Element parentNode, String tagName, boolean content) { Element elem = appendChildElement(parentNode, tagName); setBooleanContent(elem, content); return elem; }//from w w w . j a va 2 s . c o m public static Element appendChildElement(Element parentNode, String nodeName) { Document doc = parentNode.getOwnerDocument(); Element childNode = doc.createElement(nodeName); parentNode.appendChild(childNode); return childNode; } public static void setBooleanContent(Element elem, boolean value) { setTextContent(elem, value ? "true" : "false"); } public static void setTextContent(Element elem, String content) { Document doc = elem.getOwnerDocument(); if ((content != null) && !content.equals("")) { Text textNode = doc.createTextNode(content); elem.appendChild(textNode); } } }