Java tutorial
//package com.java2s; import org.w3c.dom.Element; public class Main { public static Boolean parseBoolean(Element element, String key) { String value = element.getAttribute(key); if (value != null && !value.isEmpty()) { if ("1".equals(value) || "true".equals(value)) { return true; } else { return false; } } return null; } }