Hi
To add xml file to the form, you need to create data Connection.
To create Data connection you need to do in the following way:
1. On the Tools menu, click Secondary Data Sources.
2. The Secondary Data Sources dialog box appears.
3. Click Add.
4. The Data Source Setup Wizard starts.
5. Click XML Data File for the data source type, and then click Next.
6. Click Browse. In the Open dialog box, locate Xmlfile.xml, and then click
Open. Click Next.
7. Click Finish to complete the Data Source Setup Wizard. When you are
prompted to add the file to your form, click No.
8. Click Close to close the Secondary Data Sources dialog box.
Add the following code sample to the XDocument::OnLoad event handler.
XDocument.DataObjects.Item("XMLFile").Query();
var XMLFileDOM = XDocument.GetDOM("XMLFile");
XDocument.DOM.SelectSingleNode(DOM, “Xpath of the fieldâ€);
Save your changes to the script, and then close Script Editor