codes to generate new version of XML