STAX : can we find out if the XML document has got a particular Attribute with in it?
===

I am using STAX parser to pare the XML Document .

This is my Sample XML File (The XML may change depending upon the request )

I may receive the XML in any format (Don't know the element names for different requests ) My Requirement is that can i find out if the XML document has the Symbol attribute in it and its value ??



    <daily-values>
    	<total-fat units="g">65</total-fat>
    	<saturated-fat units="g" Symbol = "CITI">20</saturated-fat>
    	<cholesterol units="mg">300</cholesterol>
    	<sodium units="mg">2400</sodium>
    	<carb units="g">300</carb>
    	<fiber units="g">25</fiber>
    	<protein units="g">50</protein>
    </daily-values>



So is there any Generic Way , i can find out if the if the XML has got Symbol attribute with in it , and can i get its value ??

I tried this way , but its executing for every eleement node 

    try {
    			// Parser
    			StringReader stringReadertext = new StringReader(XMLdocument);
    			XMLInputFactory inputFactory = XMLInputFactory.newInstance();
    			XMLStreamReader inputEventReader = inputFactory.createXMLStreamReader(stringReadertext);
    			XMLEventReader eventReader = inputFactory.createXMLEventReader(inputEventReader);
    
    			while (eventReader.hasNext()) {
    				XMLEvent event = eventReader.nextEvent();
    				if (event.isStartElement()) {
    					StartElement startElement = event.asStartElement();
    					Iterator attributes = startElement.getAttributes();
    					while (attributes.hasNext()) {
    						Attribute attribute = (Attribute) attributes.next();
    						String attributeName = attribute.getName().getLocalPart();
    						if (attributeName.contains("Symbol") == false) {
    							System.out.println("SYM iS Not  present");
    						} else {
    							System.out.println("SYM iS present");
    						}
    					}
    				}
    			}
    
    		} catch (com.ctc.wstx.exc.WstxParsingException ex) {
    			
    		} 