title: XML attribute Parsing
body: <p>When parsing the xml, I want to retrieve the token value:</p>
  
  <pre><code>PCWTJ87OXNnGhwzvzqvbhepi2qQM6PhMdNHn7V9UuVw|
  </code></pre>
  
  <p>But I am currently getting the related:</p>
  
  <pre><code>Found attribute: expiry with value: 2014-10-29T22:20:00Z
  </code></pre>
  
  <p>xml file:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;Inrix responseId="63448807-78d3-4ee8-90d6-a8b64abff8fc" statusText="" statusId="0"     createdDate="2014-10-29T21:21:55Z" versionNumber="5.4" copyright="Copyright INRIX Inc." docType="GetSecurityToken"&gt;
  &lt;AuthResponse&gt;
  &lt;AuthToken expiry="2014-10-29T22:20:00Z"&gt;PCWTJ87OXNnGhwzvzqvbhepi2qQM6PhMdNHn7V9UuVw|&lt;/AuthToken&gt;
  &lt;ServerPath&gt;devzone.inrix.com/traffic/inrix.ashx&lt;/ServerPath&gt;
  &lt;ServerPaths&gt;
  &lt;ServerPath region="NA" type="API"&gt;http://na.api.inrix.com/Traffic/Inrix.ashx&lt;/ServerPath&gt;
  &lt;ServerPath region="NA" type="TTS"&gt;http://na-rseg-tts.inrix.com/RsegTiles/tile.ashx&lt;/ServerPath&gt;
  &lt;/ServerPaths&gt;
  &lt;/AuthResponse&gt;
  &lt;/Inrix&gt;
  </code></pre>
  
  <p>This is the code I wrote to parse the xml file above:</p>
  
  <pre><code>DocumentBuilderFactory factory =DocumentBuilderFactory.newInstance();
  DocumentBuilder builder =factory.newDocumentBuilder();
  Document document = builder.parse(new File(inputfile));
  document.getDocumentElement().normalize();
  
  NodeList AuthTokens = document.getElementsByTagName("AuthToken"); 
  //NodeList AuthTokens = document.getElementsByTagName("ServerPath"); 
  int num = AuthTokens.getLength();
  for (int i=0; i&lt;num;i++){
       Element node = (Element) AuthTokens.item(i);
       NamedNodeMap attributes = node.getAttributes();
       int numAttrs = attributes.getLength();
       for (int j=0; j&lt;numAttrs;j++){
           Attr attr = (Attr) attributes.item(j);
           String attrName = attr.getNodeName();
           String attrValue = attr.getNodeValue();
           System.out.println(attr.getParentNode());
           System.out.println("Found attribute: " + attrName + " with value: " + attrValue);
       }           
   }
  </code></pre>
  
  <p>How do I get the correct value?</p>