class XmlService method .createDocument()

XmlService is the Apps Script service.

.createDocument() is the method name you will see after a dot in your code.

What it does

Creates a new empty XML document.

Why it's used

  • Build XML exports for systems that still want XML files.
  • Generate config or report files from sheet data.

Common errors

  • Forgetting parentheses on createDocument. Write XmlService.createDocument(), not XmlService.createDocument or createDocument by itself.
  • Skipping dots between chained calls. Each step needs a dot, like XmlService.createDocument().
  • Adding spaces where they do not belong. Write XmlService.createDocument(), not XmlService .createDocument(), XmlService.createDocument (), or XmlService . createDocument().
  • Wrong capitalization. Use XmlService and createDocument, not xmlservice or createdocument.

Explore

Related methods

Better Sheets tutorials

No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.