docs: public static StreamError parseStreamError(XmlPullParser parser, XmlEnvironment outerXmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
          final int initialDepth = parser.getDepth();
          List<ExtensionElement> extensions = new ArrayList<>();
          Map<String, String> descriptiveTexts = null;
          StreamError.Condition condition = null;
          String conditionText = null;
          XmlEnvironment streamErrorXmlEnvironment = XmlEnvironment.from(parser, outerXmlEnvironment);
          outerloop: while (true) {
              int eventType = parser.next();
              switch (eventType) {
              case XmlPullParser.START_TAG:
                  String name = parser.getName();
                  String namespace = parser.getNamespace();
                  switch (namespace) {
                  case StreamError.NAMESPACE:
                      switch (name) {
                      case "text":
                          descriptiveTexts = parseDescriptiveTexts(parser, descriptiveTexts);
                          break;
                      default:
                          // If it's not a text element, that is qualified by the StreamError.NAMESPACE,
                          // then it has to be the stream error code
                          condition = StreamError.Condition.fromString(name);
                          if (!parser.isEmptyElementTag()) {
                              conditionText = parser.nextText();
                          }
                          break;
                      }
                      break;
                  default:
                      PacketParserUtils.addExtensionElement(extensions, parser, name, namespace, streamErrorXmlEnvironment);
                      break;
                  }
                  break;
              case XmlPullParser.END_TAG:
                  if (parser.getDepth() == initialDepth) {
                      break outerloop;
                  }
                  break;
              }
          }
          return new StreamError(condition, conditionText, descriptiveTexts, extensions);
      }