code: private function writeHeaderFooter(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
      {
          // headerFooter
          $objWriter->startElement('headerFooter');
          $objWriter->writeAttribute('differentOddEven', ($pSheet->getHeaderFooter()->getDifferentOddEven() ? 'true' : 'false'));
          $objWriter->writeAttribute('differentFirst', ($pSheet->getHeaderFooter()->getDifferentFirst() ? 'true' : 'false'));
          $objWriter->writeAttribute('scaleWithDoc', ($pSheet->getHeaderFooter()->getScaleWithDocument() ? 'true' : 'false'));
          $objWriter->writeAttribute('alignWithMargins', ($pSheet->getHeaderFooter()->getAlignWithMargins() ? 'true' : 'false'));
  
          $objWriter->writeElement('oddHeader', $pSheet->getHeaderFooter()->getOddHeader());
          $objWriter->writeElement('oddFooter', $pSheet->getHeaderFooter()->getOddFooter());
          $objWriter->writeElement('evenHeader', $pSheet->getHeaderFooter()->getEvenHeader());
          $objWriter->writeElement('evenFooter', $pSheet->getHeaderFooter()->getEvenFooter());
          $objWriter->writeElement('firstHeader', $pSheet->getHeaderFooter()->getFirstHeader());
          $objWriter->writeElement('firstFooter', $pSheet->getHeaderFooter()->getFirstFooter());
          $objWriter->endElement();
      }
docs: Write Header / Footer.
  
  @param XMLWriter $objWriter XML Writer
  @param PhpspreadsheetWorksheet $pSheet Worksheet