How to retrieve element value from SOAP response using Java?
<p>I am trying to get the tag value from the below String response getting from salesforce,</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://soap.sforce.com/2006/04/metadata"&gt;
   &lt;soapenv:Body&gt;
      &lt;listMetadataResponse&gt;
         &lt;result&gt;
            &lt;createdById&gt;00528000001m5RRAAY&lt;/createdById&gt;
            &lt;createdByName&gt;Hariprasath Thanarajah&lt;/createdByName&gt;
            &lt;createdDate&gt;1970-01-01T00:00:00.000Z&lt;/createdDate&gt;
            &lt;fileName&gt;objects/EmailMessage.object&lt;/fileName&gt;
            &lt;fullName&gt;EmailMessage&lt;/fullName&gt;
            &lt;id /&gt;
            &lt;lastModifiedById&gt;00528000001m5RRAAY&lt;/lastModifiedById&gt;
            &lt;lastModifiedByName&gt;Hariprasath Thanarajah&lt;/lastModifiedByName&gt;
            &lt;lastModifiedDate&gt;1970-01-01T00:00:00.000Z&lt;/lastModifiedDate&gt;
            &lt;namespacePrefix /&gt;
            &lt;type&gt;CustomObject&lt;/type&gt;
         &lt;/result&gt;
      &lt;/listMetadataResponse&gt;
   &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;
</code></pre>

<p>Above we had the tag <code>&lt;fullName&gt;</code>. I'll need to get the value inside the tag and put it in the String array. I have tried with substring method but It returns only one value. Can anyone suggest me to do this? </p>