First off all I didn't find better title for my question, so please update if you have some words.

**What I am doing :**

*In current I am sending two request for this purpose(One for user validation, another for data, if user is authorised). But I want to use single request.*

**What I want :** 

I will send a request as POST method to server where server will send a XML as response depends on my request.

For example : 

* I am sending user and password to server.
* Server authenticate that user.
* If user authorised, server sends response xml as

![enter image description here](https://i.stack.imgur.com/Kvan5.png)
* If authentication failed, server sends response as

![enter image description here](https://i.stack.imgur.com/fHIgo.png)

Problem I faced : 

I am not able to handle XML data, actually not identify the xml data. 

***I am using android.sax parser and I created two parser classes for both type of xml response, But how can I identify which parser class should I use depends on response?***

Update : 

Here is my actual xml

![enter image description here](https://i.stack.imgur.com/sT8E0.png)![enter image description here](https://i.stack.imgur.com/iIuw8.png)

So how can I parse it, using single parser?