This regular expression is designed to tokenize XML content by identifying major XML constructs through named capture groups. It detects processing instructions (PI), DTD blocks, CDATA sections, comments, self‑closing tags, opening tags, closing tags, and plain text. It is suitable for building lightweight XML lexers or preprocessing XML before deeper parsing.