You can find the sample in the attachment or you can see it in action here.
Here's another sample. This time on how to serve an XML document from an OutSystems application.
Check the xmldoc screen's preparation action. It end with a Download, which makes the server render an xml document, instead of a web page. The preceeding logic creates the content and transforms it into a binary file.
Note: you need to use the BinaryData extension, which is packaged with the Enterprise Manager solution, available here.
Attached is a version of the XmlSample.oml eSpace for Outsystems 5.0 .