private void skip(XmlPullParser parser) throws XmlPullParserException, IOException {
        if (parser.getEventType() != XmlPullParser.START_TAG) {
            throw new IllegalStateException();
        }
        int depth = 1;
        while (depth != 0) {
            switch (parser.next()) {
                case XmlPullParser.END_TAG:
                    depth--;
                    break;
                case XmlPullParser.START_TAG:
                    depth++;
                    break;
            }
        }
    }
Parses an MPD XML file. This needs to be executed off the main thread, else a
NetworkOnMainThreadException gets thrown.
@param source the URl of an MPD XML file
@return a MPD object
@throws android.os.NetworkOnMainThreadException if executed on the main thread
MediaPlayer-DASH/src/main/java/net/protyposis/android/mediaplayer/dash/DashParser.java