Reading through the string in xml format and get the values of elements in java
<p>I have the a string in XML format. I want to read it and get the values of the elements.</p>

<p>I have tried Java JAXBContext unmarshell at <a href="http://rocksolutions.wordpress.com/2010/08/10/jaxb-unmarshalling-strings-xmls/" rel="nofollow">here</a>. But this needs creation of class which is not necessary for me.</p>

<p>String:</p>

<pre><code>&lt;customer&gt;
    &lt;age&gt;35&lt;/age&gt;
    &lt;name&gt;aaa&lt;/name&gt;
&lt;/customer&gt;
</code></pre>

<p>I want to get the values of age and name.</p>

<p>Can any one help me.</p>
