How to parse SOAP response?

"T.J. Hoo" <[email protected]>
Newsgroups gmane.text.xml.soap.user
Message-ID <[email protected]>
Hi!

I'm writing a standalone client to construct and send a SOAP message to a
server.
The response received from the server looks like the following:

    HTTP/1./1 200 OK
    ...
    <env:Envelope...>
      ...
      <env:Body>
        <Response>
          <Status>
            <Code>0</Code>
          </Status>
        </Response>
      </env:Body>
    </env:Envelope>


and currently, the program parses the response like the following:

    SOAPTransport st = msg.getSOAPTransport ();
    BufferedReader br = st.receive ();
    String line;
    while ((line = br.readLine ()) != null) {
      if (line.indexOf("<Code>0</Code") >= 0)
	   return true;
    }
    return false;


the above code looks ugly and gross, and I want to know how to convert the
SOAP response into a XML document/Envelope object so that I'm able to lookup
the XML element value easily. Is this possible?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.