Stupid thing to make xpath queries easier from bash. Try a quick google for bash xpath
and you might be disappointed. #wahwahwah
NB - due to dependence on gokogiri, you need to install libxml2-devel to build this. (Sorry, I'm still a bit of a golang n00b. 😊)
It'll read from stdin by default
yum install libxml2-devel # see above, soz
go get github.com/boyvinall/goxpath
./goxpath -xmlns foo:http://foo -xmlns bar:http://bar -xpath //foo:stuff/bleh -file file.xml
./gopath -h # NB: see ENV names e.g. $XP_XMLNS
curl -s http://example.com/doc.xml | goxpath -xpath //example
export XP_XMLNS=foo:http://foo,bar:http://bar # define in the ENV, separate with comma
goxpath -xpath //foo:stuff file.xml