I can't explain how the code flow could be reach at a point like this (maybe in a race), but the following code reproduce the OOME.
Reader reader = new StringReader("<iq type=\"result\" from=\"you\" to=\"me\"/>");
XmlPullParser parser = XmlPullParserFactory.newInstance().newPullParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
parser.setInput(reader);
int parserDepth = parser.getDepth(); // will be 0
String content = PacketParserUtils.parseContentDepth(parser, parserDepth);