docs: @CheckForSigned
    public static int readXMLElement (final StringBuilder aSB,
                                      final String sIn,
                                      final int nStart,
                                      final boolean bSafeMode)
    {
      try
      {
        if (sIn.charAt (nStart + 1) == '!')
        {
          aSB.append ("<!");
          return nStart + 1;
        }
  
        int pos;
        boolean bIsCloseTag;
        if (sIn.charAt (nStart + 1) == '/')
        {
          bIsCloseTag = true;
          pos = nStart + 2;
        }
        else
        {
          bIsCloseTag = false;
          pos = nStart + 1;
        }
  
        if (bSafeMode)
        {
          final StringBuilder temp = new StringBuilder ();
          pos = _readRawUntil (temp, sIn, pos, ' ', '/', '>');
          if (pos == -1)
            return -1;
          final String tag = temp.toString ().trim ().toLowerCase (Locale.US);
          if (MarkdownHTML.isUnsafeHtmlElement (tag))
          {
            aSB.append ("&lt;");
            if (bIsCloseTag)
              aSB.append ('/');
            aSB.append (temp);
          }
          else
          {
            aSB.append ('<');
            if (bIsCloseTag)
              aSB.append ('/');
            aSB.append (temp);
          }
        }
        else
        {
          aSB.append ('<');
          if (bIsCloseTag)
            aSB.append ('/');
          pos = _readRawUntil (aSB, sIn, pos, ' ', '/', '>');
        }
        if (pos == -1)
          return -1;
        pos = _readRawUntil (aSB, sIn, pos, '/', '>');
        if (sIn.charAt (pos) == '/')
        {
          aSB.append (" /");
          pos = readRawUntil (aSB, sIn, pos + 1, '>');
          if (pos == -1)
            return -1;
        }
        if (sIn.charAt (pos) == '>')
        {
          aSB.append ('>');
          return pos + 1;
        }
      }
      catch (final StringIndexOutOfBoundsException e)
      {
        return -1;
      }
      return -1;
    }