code: public static XmlPullParser newXmppParser() throws XmlPullParserException {
          XmlPullParser parser = XmlPullParserFactory.newInstance().newPullParser();
          parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
          if (XML_PULL_PARSER_SUPPORTS_ROUNDTRIP) {
              try {
                  parser.setFeature(FEATURE_XML_ROUNDTRIP, true);
              }
              catch (XmlPullParserException e) {
                  LOGGER.log(Level.SEVERE,
                                  "XmlPullParser does not support XML_ROUNDTRIP, although it was first determined to be supported",
                                  e);
              }
          }
          return parser;
      }
docs: Creates a new XmlPullParser suitable for parsing XMPP. This means in particular that
  FEATURE_PROCESS_NAMESPACES is enabled.
  <p>
  Note that not all XmlPullParser implementations will return a String on
  <code>getText()</code> if the parser is on START_TAG or END_TAG. So you must not rely on this
  behavior when using the parser.
  </p>
  
  @return A suitable XmlPullParser for XMPP parsing
  @throws XmlPullParserException