Added code to generate the portal XML file.