XML Generation Reference
The generate XML command converts an XML Document or XML Element class into XML text. The resulting XML data may be returned to AppleScript for further processing or it may be written to a file. XML characters (‘<‘ and ‘&’) are automatically escaped as part of the XML generation process.
Generate XML Syntax
generate XML <xml document/xml element> --> XML-formatted string generate XML <xml document/xml element> saving as <file specification> --> alias to resulting file