I've been recently developing XSL transformations. I've been implementing C++ code to edit XML files using XPath values too.
I had previously used xsltproc, the command line utility distributed together with libxslt to test and debug my XSL transformations.
I have also used xmllint to validate hand-written XML files in order to be both well-formed and valid against a given DTD or XSchema.
But I recently discovered a wonderful xmllint feature: the --shell option. It runs an interactive shell that allows the user to navigate within the XML document as in a file system. But navigating is not the most useful feature I found for the shell option: it's the xpath command.
It allows to quickly check what node-set will be obtained when applying an XPath expression to a given XML input file.
It's a really useful utility when writing complex XPath expressions or checking out results for XPath expressions on complex documents.