Fixed bug in XML generation