Hi! I can do this with library XML for R, not python, in which I have more than 4 years professional academic experience. It's quite easy to produce XML with it. I'm also professional in regular expressions, both POSIX and Perl-like. You'll get the whole script, with clear comments and all instructions. I also support my clients even after the payment is being made. Please look at my portfolio, there're code snapshots also. I'm ready to discuss any detail!
Best, Stas