code: public String getValueOfTagAttribute(final String xmlString,
  			final String tagName, final String attribute)
  			throws ParserConfigurationException, SAXException, IOException {
  
  		NodeList nodes = this.getNodeList(xmlString, tagName);
  
  		LOG.info("Elements returned = " + nodes.getLength());
  
  		Element element = (Element) nodes.item(0);
  
  		LOG.info("element text = " + element.getAttribute(attribute));
  
  		return element.getAttribute(attribute);
  
  	}
docs: You must pass the xml string the tag name and the attribute of the tag
  that you want to be returned This should be called for situations like
  this: &lt;age gender="male"&gt;18&lt;/age&gt;.
  
  In this case, in order to get the MALE value we call the method like
  this: getValueOfTagAttribute(xml, "age", "gender"); and this will return
  MALE
  
  The method returns the first tag it encounters.
  
  @param xmlString
  the XML string
  @param tagName
  the tag name
  @param attribute
  the attribute name
  @return the value of the {@code attribute} corresponding to the
  {@code tagName}
  
  @throws ParserConfigurationException
  if something goes wrong while parsing the XML
  @throws SAXException
  if XML is malformed
  @throws IOException
  if something goes wrong when reading the file