Java tutorial
//package com.java2s; import org.w3c.dom.Element; public class Main { public static String parseString(Element element, String key) { String value = element.getAttribute(key); if (value != null && !value.isEmpty()) { return value; } return null; } }