docs: @Override
      public RosterExchange parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment)
                      throws XmlPullParserException, IOException {
          // CHECKSTYLE:OFF
          RosterExchange rosterExchange = new RosterExchange();
          boolean done = false;
          RemoteRosterEntry remoteRosterEntry;
          Jid jid = null;
  		String name = "";
  		ArrayList<String> groupsName = new ArrayList<>();
          while (!done) {
              int eventType = parser.next();
              if (eventType == XmlPullParser.START_TAG) {
                  if (parser.getName().equals("item")) {
                  	// Reset this variable since they are optional for each item
  					groupsName = new ArrayList<>();
  					// Initialize the variables from the parsed XML
                      jid = ParserUtils.getJidAttribute(parser);
                      name = parser.getAttributeValue("", "name");
                  }
                  if (parser.getName().equals("group")) {
  					groupsName.add(parser.nextText());
                  }
              } else if (eventType == XmlPullParser.END_TAG) {
                  if (parser.getName().equals("item")) {
  					// Create packet.
  					remoteRosterEntry = new RemoteRosterEntry(jid, name, groupsName.toArray(new String[groupsName.size()]));
                      rosterExchange.addRosterEntry(remoteRosterEntry);
                  }
                  if (parser.getName().equals("x")) {
                      done = true;
                  }
              }
          }
          // CHECKSTYLE:ON
          return rosterExchange;
  
      }