XSH - XML Editing Shell
Sounds like something I should check out: "XSH is a fast and powerfull command-line XML editor. It may be used to query and modify XML documents. XSH may be used either interactivelly or for off-line processing (like bash). XPath expressions are used to select parts of XML document to be processed."