xml.save(file, node)function

Serializes a Node object and writes it to an XML file.

Parameters

file

A File object or a filename string representing the destination XML file.

node

The Node object to be saved.

Return value

Returns true on success or false in case of error.

Example

--! luart-extensions import xml -- Create a new Node local root = xml.Node("greeting") root.text = "Hello, world!" -- Save to file xml.save("greeting.xml", root)