In calibration analysis put xml generation in a separate function