code: private void readContentSpec() throws IOException, XmlPullParserException {
          // this implementation is very lenient; it scans for balanced parens only
          skip();
          int c = peekCharacter();
          if (c == '(') {
              int depth = 0;
              do {
                  if (c == '(') {
                      depth++;
                  } else if (c == ')') {
                      depth--;
                  } else if (c == -1) {
                      throw new XmlPullParserException(
                              "Unterminated element content spec", this, null);
                  }
                  position++;
                  c = peekCharacter();
              } while (depth > 0);
  
              if (c == '*' || c == '?' || c == '+') {
                  position++;
              }
          } else if (c == EMPTY[0]) {
              read(EMPTY);
          } else if (c == ANY[0]) {
              read(ANY);
          } else {
              throw new XmlPullParserException("Expected element content spec", this, null);
          }
      }
docs: Read an element content spec. This is a regular expression-like pattern
  of names or other content specs. The following operators are supported:
  sequence:    (a,b,c)
  choice:      (a|b|c)
  optional:    a?
  one or more: a+
  any number:  a*
  
  The special name '#PCDATA' is permitted but only if it is the first
  element of the first group:
  (#PCDATA|a|b)
  
  The top-level element must be either a choice, a sequence, or one of the
  special names EMPTY and ANY.