in reply to Re^2: Getting start and end xml tags
in thread Getting start and end xml tags

Unless you are dealing with very trivial, very static (X|HT|SG)ML markup the answer to "How do I do X with my FOOML" is pretty much invariably going to entail starting off "Use a FOOML parsing module, then . . .". See Why a regex *really* isn't good enough for HTML and XML, even for "simple" tasks for a recent, good pathological example why.

Even if you think you've really got something trivial you're then betting against yourself that that format will never change and have baked an unspoken brittleness into your code.

The cake is a lie.
The cake is a lie.
The cake is a lie.