Java tutorial
//package com.java2s; import org.w3c.dom.Node; public class Main { public static String getId(Node node) { return node.getAttributes().getNamedItem("id").getNodeValue(); } }