On sweetcode, which is a great place for finding the more offbeat and interesting software projects, I found XSH, the "XML Editing Shell". This is a perl module that uses the metaphor of a file system with directories to represent an XML document with elements. It provides a shell for traversing and manipulating the file system using commands analogous to the unix shell commands. For example, cd is used to change the current context to different elements with the argument being the xpath to the target element; ls is used to list the current context. Of course commands are also provided to add new elements and attributes, and even to apply style sheets. I suggest reading the article at xml.com first for an overview.
I've always been interested in systems that attempt to use an existing conceptual model from one domain in another domain. If done successfully it makes it easier for new users to understand and learn the system as they are able to apply knowledge from the domain they already know to the new tool. The danger is that any conceptual mismatch between the old known model and the model of the system being learnt can prove very jarring.
Just after I first posted this I realised how easy it would be to implement something like this is scheme or lisp. The read-eval-print loop is already built in. All that would be needed is to implement the cd, ls etc. commands as scheme/lisp functions and it would work. Using Oleg's scheme xml tools as a basis I could imagine even me knocking this together.