slightly updated xml generation