XML View
XML view can be used for any sort of export performed via XML documents.
To create an XML view, you have to provide an XML template and, optionally, XSD schema(s).
XML document generation is generally based on context data and corresponding XSD schema(s). However there is no straight-forward way to automatically map data to XSD structures. It can be accomplished by different approaches and the most official of them is XSLT transformation. However XSLT transformation is not intuitive and is complex for learning. So we have worked out an approach based on XML template document containing resulting XML structure with data placeholders. Its syntax is described in the following article.
When you have an XML template ready, the next step is to launch generation and get the resulting document. There are 2 ways for this.
The first one is simpler and needs just adding a button with 'DOWNLOAD_XML' server event. However with this approach you do not have any configuration options. The button will start generation with the default XML view, the output filename will be based on the XML template filename and XSD validation will be performed always if XSD schema(s) is provided. If you need to control these options on your own then you may consider the second approach.
Another way is to create a custom action block running on client side and calling app.wizardView.downloadXml(options) function. The options argument is an object with fields viewId, filename and skipValidation. All the fields are optional. Here is a code example:
app.wizardView.downloadXml({ viewId: '2500000024117645726', skipValidation: true, filename: "test22.xml"})