The below code is useful to create XML and XSD file. Create Application engine program with below code and run the AE program in App designer to get a file in local. You can get the same in server without specifying any path and give it as relative path instead of file absolute.
PSXP_XMLGEN application package used to create xml file. You can multiple parent and child records. This file is used for data import or export programs.