Fixed bug in XML generation -- xml generation is now slow