I generally have used XSLT to do the conversion. It's not too complicated once you learn the basics. I've also used it for converting XML into vCards and iCal files. Unfortunately it's hard to find a direct tutorial for doing this XSLT so I can't link much at the moment.