Add support for pattern grouping in XML.