title: Accessing values using XML keyname
body: <p>I have XML similar to this contained in a <code>Document</code> object (<code>org.w3c.dom.Document</code>) in my code:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;root&gt;
      &lt;key keyname="info"&gt; &lt;/key&gt;
      &lt;key keyname="name"/&gt;
      &lt;key keyname="address"/&gt;
      &lt;key keyname="id"&gt;13&lt;/key&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>I would like to be able to access each <code>key</code> node and print out its value, and be able to print out each value with its corresponding <code>keyname</code></p>
  
  <p>I have never worked with XML using <code>keyname</code> before, how do I access these values?</p>