Have written the full validation process and the system now also creates the xml file for archiving.