Update: I've basically got the plugin system working along with a xhtml plugin. However there is one problem - KTrader doesn't like colons in the query when I use the namespace uri. Is there a way to escape it? (I'm simply stripping them out at the moment). Secondly, is it OK for me to create a branch so I can keep track of what I'm doing? Thanks, Paul.