docs: public final static int readXMLUntil(final StringBuilder out, final String in, final int start, final char... end)
      {
          int pos = start;
          boolean inString = false;
          char stringChar = 0;
          while (pos < in.length())
          {
              final char ch = in.charAt(pos);
              if (inString)
              {
                  if (ch == '\\')
                  {
                      out.append(ch);
                      pos++;
                      if (pos < in.length())
                      {
                          out.append(ch);
                          pos++;
                      }
                      continue;
                  }
                  if (ch == stringChar)
                  {
                      inString = false;
                      out.append(ch);
                      pos++;
                      continue;
                  }
              }
              switch (ch)
              {
              case '"':
              case '\'':
                  inString = true;
                  stringChar = ch;
                  break;
              }
              if (!inString)
              {
                  boolean endReached = false;
                  for (int n = 0; n < end.length; n++)
                  {
                      if (ch == end[n])
                      {
                          endReached = true;
                          break;
                      }
                  }
                  if (endReached)
                  {
                      break;
                  }
              }
              out.append(ch);
              pos++;
          }
  
          return (pos == in.length()) ? -1 : pos;
      }