Updated automatic XML script