fixed xml generation bug