A lightweight toolkit for efficient processing of XML data. The tools are analagous to the UNIX command-line text processing tools sort, grep, etc. The infrastructure includes an efficient DFA-based engine for streaming evaluation of XPath expressions.