Java - Retrieve values from String, implementing either Scanner() or Pattern() & Matcher(), or other
<p>I have a <code>String</code>:</p>

<pre><code>    String message1 = "Request: &lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.me.test.com"&gt;
    &lt;soapenv:Header/&gt;
    &lt;soapenv:Body&gt;
       &lt;ws:RequestTypeOne&gt;
          &lt;userId&gt;user_name_one&lt;/userId&gt;
       &lt;/ws:RequestTypeOne&gt;
    &lt;/soapenv:Body&gt;
 &lt;/soapenv:Envelope&gt;";
</code></pre>

<p>1) I need to be able to able to extract the starting word - it can be either <em>Request</em> or <em>Repsonse</em>, so I can store in another <code>String</code>. </p>

<p>2) I need to be able to extract what is in between the  tag, and store this into another String too.</p>

<p>I have had a go with <code>Scanner()</code> with <code>useDelimiter()</code>, but I am not sure how to implement this. I have also tried pattern() and matcher() but I am not sure this is the best for this requirement.</p>

<p>Can anyone help please?</p>
