parsing xml Data
<p>I have the following XML data. How do I track the error tag in case of an invalid request or input?  </p>

<p>If it is possible then can you please provide me proper code for this? </p>

<p>Login Request:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
  &lt;soap:Body&gt;
    &lt;Signin xmlns="http://tempuri.org/"&gt;
  &lt;card_number&gt; 123/321 &lt;/ card_number &gt;
   &lt;dob&gt;MM|DD|YYYY &lt;/dob &gt;
    &lt;/Signin&gt;
  &lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;
</code></pre>

<p>Response:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
  &lt;soap:Body&gt;
    &lt;SigninResponse xmlns="http://tempuri.org/"&gt;
      &lt;user&gt;
        &lt;user_id&gt;long&lt;/user_id&gt;
        &lt;current_balance&gt;string&lt;/current_balance&gt;
        &lt;card_iamge&gt;&lt;![CDATA[string]]&gt;&lt;/card_iamge&gt;
      &lt;/user&gt;
    &lt;/SigninResponse&gt;
  &lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;
</code></pre>

<p>Transaction History Request:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
  &lt;soap:Body&gt;
    &lt;TransactionHistory xmlns="http://tempuri.org/"&gt;
  &lt; user_id &gt;1/2 &lt;/ user_id &gt;


    &lt;/TransactionHistory&gt;
  &lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;
</code></pre>

<p>Response:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
  &lt;soap:Body&gt;
    &lt;TransactionHistoryResponse xmlns="http://tempuri.org/"&gt;
      &lt;transactions&gt;
        &lt;transaction&gt;
  &lt;date&gt;&lt;![CDATA[08/30/2010]]&gt;&lt;/date&gt;
  &lt;amt&gt;$10.50&lt;/amt&gt;
  &lt;card&gt;ASYU763543&lt;/card&gt;
      &lt;/transaction&gt;
        &lt;transaction&gt;
  &lt;date&gt;&lt;![CDATA[08/30/2010]]&gt;&lt;/date&gt;
  &lt;amt&gt;$10.50&lt;/amt&gt;
  &lt;card&gt;ASYU763543&lt;/card&gt;
      &lt;/transaction&gt;
&lt;transaction&gt;
  &lt;date&gt;&lt;![CDATA[08/30/2010]]&gt;&lt;/date&gt;
  &lt;amt&gt;$10.50&lt;/amt&gt;
  &lt;card&gt;ASYU763543&lt;/card&gt;
      &lt;/transaction&gt;
      &lt;/transactions&gt;
    &lt;/TransactionHistoryResponse&gt;
  &lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;
</code></pre>

<p>Error:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
  &lt;soap:Body&gt;
    &lt;*Response xmlns="http://tempuri.org/"&gt;
  &lt; error&gt; string &lt;/ error &gt;
    &lt;/&lt;*Response&gt;
  &lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;
</code></pre>
