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.

Big Year 2027 calendar: the whole year on one Google Sheet

Free 2027 calendar.Plan all of 2027 on one Google Sheet, free.

Copy it to your Google Drive.

Free. No password, no card. The sheet link shows up right here.