XML::LibXML does this best, I find.. (I cant remember why I didnt like the others, though) It's a little top heavy as it requires external libxml libraries etc, but it can do most everything XMLish you'll ever need (well, more or less, I worked on a 'validate/create skeleton XML from DTD' for a while, but it's now lying around mostly finished..
C.