code: private function writeComment(XMLWriter $objWriter, $pCellReference, Comment $pComment, array $pAuthors)
      {
          // comment
          $objWriter->startElement('comment');
          $objWriter->writeAttribute('ref', $pCellReference);
          $objWriter->writeAttribute('authorId', $pAuthors[$pComment->getAuthor()]);
  
          // text
          $objWriter->startElement('text');
          $this->getParentWriter()->getWriterPart('stringtable')->writeRichText($objWriter, $pComment->getText());
          $objWriter->endElement();
  
          $objWriter->endElement();
      }
docs: Write comment to XML format.
  
  @param XMLWriter $objWriter XML Writer
  @param string $pCellReference Cell reference
  @param Comment $pComment Comment
  @param array $pAuthors Array of authors
  
  @throws \PhpOffice\PhpSpreadsheet\Writer\Exception