The fundamental idea is to require of a tree-like object a simple API [1] and to use that to generate and filter a list of tree nodes by using methods which map or apply methods and predicates to the nodes in the node set.

The language form is very tcl-ish and quite free-form, which was entirely inspired by Cost.

I should point out, in passing, that this approach is quite non-standard, and there are other more standard approaches to the problem of searching and editing trees, such as the excellent tdom.

20041001 treeql is now part of tcllib. AKU ported it to tcl8.4, and helped a lot with QA.

dbohdan 2015-01-11: This neat little language appears to be severely underused by tclers. Consider that it provide access to hierarchical documents in the age of the Web and is already there in Tcllib. The lack of examples on the wiki may be one reason for it, so I've added the one I wrote while figuring it out at Web Scraping with htmlparse (processing trees generated by htmlparse seems like the killer app for TreeQL). The man page could use more examples as well.