It's possibly a hack but ignoring a level of abstraction for the sake of simplicity works in a lot of cases absolutely fine.
Let's also add the constraint that an XML parser can't mathematically parse broken XML whereas a regular expression can extract data from XML. That end of the problem is far more interesting.
GEB made me appreciate this fact after some rather late nights and considerable amounts of alcohol.
To be fair, I noted this limitation in the example, and said that if the nesting structure is important, you should use a tool that can handle context-free languages.
My more general warning was that if you find yourself exploiting the Turing-completeness of sed, you're using the wrong tool.
However, many regular expression implementations are not regular and have enough power to parse nested structures.