perl extension for generating XML
Index | textproc
In general, once you have an XML::Generator object, you then simply call methods on that object named for each XML tag you wish to generate.