in reply to tgrep - A grep for HTML tags

Interesting.

You could consider also the xpath utility that comes with XML::XPath, as long as XML::XSH, that let you cope with XML document using a shell metaphor.
Useful articles from www.xml.com: