title: Get an attribute of a dom node
body: <p>I am trying to get an attribute of an xml node example:</p>
  
  <pre><code>&lt;Car name="Test"&gt;
  &lt;/Car&gt;
  </code></pre>
  
  <p>I want to grab the name attribute of the car node.  </p>
  
  <pre><code>DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
  DocumentBuilder db = dbf.newDocumentBuilder();          
  Document doc = db.parse(configFile);
  doc.getDocumentElement().normalize();           
  NodeList layerConfigList = doc.getElementsByTagName("CAR");
  Node node = layerConfigList.item(0);
  // get the name attribute out of the node.
  </code></pre>
  
  <p>this is where i get stuck because the only  method that looks like i can use is getAttributes() with returns a NamedNodeMap and im not sure how to extract it from that.</p>