Java tutorial
//package com.java2s; import org.w3c.dom.*; public class Main { public static Node getAttributeNode(Node sNode, String attribName) { NamedNodeMap attrs = sNode.getAttributes(); if (attrs != null) { return attrs.getNamedItem(attribName); } return null; } }