From that there is a two-level index to be contructed. In all cases where text content in elements or attributes has additional structure which is not marked but has to be distinguished for transformation or layout, there is the need for additional functionality to extract parts of the content.
Regular expressions are the tool of choice for that task.
For information which has predefined values like attribute names, I don't see a need for regular expression search. I hope to have added a useful thought to the discussion.