> 
> **Possible Duplicate:**  
> 
> [How to use StaX](https://stackoverflow.com/questions/12061125/how-to-use-stax) 
> 
> 
> 

Hey guys so I have an XML file and I want Java to spit out the value of a specific tag. For example here is my XML: 

```
<?xml version="1.0"?>
    <dennis>
        <hair>brown</hair>
        <pants>blue</pants>
        <gender>male</gender>
    </dennis>

```

So let's say I want Java to spit out the value of "gender" is there code I could use like 

```
XMLStreamReader.goToTag("gender");
System.out.println(XMLStreamReader.getLocalName());

```