Add script to gen closure fomr xml