How to parse XML inputstream into string or objects (Android studio)
<p>Iam new with android and Java. (I can program in C#) and iam trying to retrieve some XML file from the internet and parse it into objects. Iam struggling with it for hours right now. I think it isn't very complicated but i cant find the right way to do it.</p>

<p>Iam started with <a href="http://developer.android.com/training/basics/network-ops/xml.html" rel="nofollow">this</a> but there is a lot of stuff in it i don't need so i tried to write some clean code with only the things i need. I read a lot of articles on the internet but i cant get them working....</p>

<p>I created an default project in android studio with one Activity. I created an subclass in this activity caled XmlManager. This subclass extends the AsyncTask. This are the methods in it:</p>

<pre><code>private class XmlManager extends AsyncTask&lt;String,String,String&gt; {
@Override
protected String doInBackground(String... inputUrl)
{
    Log.i("XML Status", "ASync proces started");
    getStream(inputUrl[0]);
    Log.i("XML Status", "ASync proces finished");
    return null;
}

@Override
protected void onPostExecute(String result)
{
    //Here i want to return the list with objects...
    // OR an string with the XML so i can parse it somewhere else,
    // I dont know what is the best practice
}

private void getStream(String urlString) {

    URL url =null;
    HttpURLConnection urlConnection = null;
    InputStream is = null;

    try {
        url = new URL(urlString);
        Log.i("Status", "Connection opened");
        urlConnection  = (HttpURLConnection) url.openConnection();
        urlConnection.setRequestMethod("GET");
        urlConnection.connect();

        is = urlConnection.getInputStream();
        Log.i("Status", "Streamreader filled");
    }
    catch (Exception e) {
        Log.e("Error",e.getMessage().toString());
    }
    finally {
        if (urlConnection != null) {
            urlConnection.disconnect();
            Log.i("Status","Connection disconnected");
        }
    }
}
</code></pre>

<p>Can someone help me please? or have an link to an WORKING and EASY example(i cant find :'( )</p>

<p>I read something about a Simple XML library for parsing XML to objects, is this the way to do it? try to retrieve XML as string or something and then parse it with any library?</p>

<p>Thanks in advance! </p>