in reply to Hash to XML

Check out XML::Simple. The XMLOut() method should do what you want.