I don't see the need of a POJO class here. You have not parsed the tags also you have not used the POJO class any where.
More info @
http://developer.android.com/training/basics/network-ops/xml.html
If you are trying to follow the docs check the topic umder Parse XML
Considering you have a xml as below
<?xml version="1.0" encoding="utf-8"?>
<ValidateUser>
<userName>admin</userName>
<password>admin</password>
</ValidateUser>
Then
InputStream open = ActivityName.this.getAssets().open("xmlname.xml");
If you have xm in raw folder
InputStream open = getResources().openRawResource(R.raw.temp);
Then
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
XmlPullParser xpp = factory.newPullParser();
xpp.setInput(open, "UTF_8");
boolean insideItem = false;
// Returns the type of current event: START_TAG, END_TAG, etc..
int eventType = xpp.getEventType();
while (eventType != XmlPullParser.END_DOCUMENT) {
if (eventType == XmlPullParser.START_TAG) {
if (xpp.getName().equalsIgnoreCase("ValidateUser")) {
insideItem = true;
} else if (xpp.getName().equalsIgnoreCase("userName")) {
if (insideItem)
Log.i("....",xpp.nextText()); // extract the
// userName
} else if (xpp.getName().equalsIgnoreCase("password")) {
if (insideItem)
Log.i("....",xpp.nextText()); // extract the passwrod
}
} else if (eventType == XmlPullParser.END_TAG
&& xpp.getName().equalsIgnoreCase("ValidateUser")) {
insideItem = false;
}
eventType = xpp.next(); // move to next element
}
The Log
08-24 14:45:17.888: I/....(1108): admin
08-24 14:45:17.888: I/....(1108): admin