Nauman Leghari as an awesome tool on his blog called Visual XPath. I’ve been using it for some time now to mine through XML documents and fragments to build up xpath queries. It has a great UI, but most of all, source code!

So, go git!