Google Apps Script API
    Preparing search index...

    A formatter for outputting an XML document, with three pre-defined formats that can be further customized.

    // Log an XML document with specified formatting options.
    var xml = '<root><a><b>Text!</b><b>More text!</b></a></root>';
    var document = XmlService.parse(xml);
    var output = XmlService.getCompactFormat()
        .setLineSeparator('\n')
        .setEncoding('UTF-8')
        .setIndent('   ')
        .format(document);
    Logger.log(output);
    
    interface Format {
        format(document: GoogleAppsScript.XML_Service.Document): string;
        format(element: GoogleAppsScript.XML_Service.Element): string;
        setEncoding(encoding: string): GoogleAppsScript.XML_Service.Format;
        setIndent(indent: string): GoogleAppsScript.XML_Service.Format;
        setLineSeparator(separator: string): GoogleAppsScript.XML_Service.Format;
        setOmitDeclaration(
            omitDeclaration: boolean,
        ): GoogleAppsScript.XML_Service.Format;
        setOmitEncoding(omitEncoding: boolean): GoogleAppsScript.XML_Service.Format;
    }
    Index

    Methods