My favourite tool for processing and creating XML is
XML::XSH2 , which I also accidentally maintain. Its interactive shell is great for experimenting with XPath expressions and more complex structures. It's a wrapper around
XML::LibXML , so if speed is a concern (alas, xsh is slow), it's possible to easily rewrite the whole thing into
XML::LibXML , but I find
XML::LibXML too verbose, and doubly so for creating XML, so in the end, I usually use
Template or some other templating system available.
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord
}map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,