util/gen_xmlpool: Make use of python's foreach loop