Code example for Element

Methods: getAttributes

     * @param node Element to find the attribute from 
     * @param name attribute to get 
     * @return the string in the specified element, or null if the attribute doesn't exist or if an error occurs 
    public static String getSimpleAttributeText(Element node, String name) {
        NamedNodeMap nnm = node.getAttributes();
        Node n = nnm.getNamedItem(name);
        try { 
            return n.getNodeValue();
        } catch (Exception e) {
            return null;