Result = ExportXML(#XML, *Address, Size [, Flags])
Writes the XML tree as markup to the given memory buffer.


#XML The XML to export.
*Address A writable memory location.
Size Size (in bytes) of the memory location.
Flags (optional) It can be a combination of the following values (with the '|' operator):
  #PB_XML_StringFormat : Includes a byte order mark. See WriteStringFormat() for more information.
  #PB_XML_NoDeclaration: Does not include the XML declaration.
Note: According to the XML specification, the XML declaration can only be omitted if the document is encoded in UTF-8 or UTF-16 or if the encoding information is provided externally through a transfer protocol for example. Even then, it is advised to keep the declaration in the document.

Return value

Nonzero if the specified length was large enough to hold the entire markup of the tree. ExportXMLSize() can be used to determine the needed size for this buffer.


The created XML markup is not reformatted. It is written back as it was initially parsed/created. The amount of newline/whitespace written between the tags is stored in the 'text' of each XML node. (see GetXMLNodeText() for more information) To reformat the XML markup before saving, the 'text' for each XML node can be altered or FormatXML() can be used to apply some common reformatting options to the tree.

See Also

ExportXMLSize(), FormatXML(), ComposeXML(), SaveXML()

Supported OS


<- ExamineXMLAttributes() - XML Index - ExportXMLSize() ->