function myFunction() { var doc = DocumentApp.openById('1GZ6ht9md7gwRTtmGBjILn0wfiKdT7vHM7Cet_2zOVOk'); doc.appendParagraph('<date>ABC</date>'); doc.saveAndClose(); }