code: private function writeBorder(XMLWriter $objWriter, Borders $pBorders)
      {
          // Write border
          $objWriter->startElement('border');
          // Diagonal?
          switch ($pBorders->getDiagonalDirection()) {
              case Borders::DIAGONAL_UP:
                  $objWriter->writeAttribute('diagonalUp', 'true');
                  $objWriter->writeAttribute('diagonalDown', 'false');
  
                  break;
              case Borders::DIAGONAL_DOWN:
                  $objWriter->writeAttribute('diagonalUp', 'false');
                  $objWriter->writeAttribute('diagonalDown', 'true');
  
                  break;
              case Borders::DIAGONAL_BOTH:
                  $objWriter->writeAttribute('diagonalUp', 'true');
                  $objWriter->writeAttribute('diagonalDown', 'true');
  
                  break;
          }
  
          // BorderPr
          $this->writeBorderPr($objWriter, 'left', $pBorders->getLeft());
          $this->writeBorderPr($objWriter, 'right', $pBorders->getRight());
          $this->writeBorderPr($objWriter, 'top', $pBorders->getTop());
          $this->writeBorderPr($objWriter, 'bottom', $pBorders->getBottom());
          $this->writeBorderPr($objWriter, 'diagonal', $pBorders->getDiagonal());
          $objWriter->endElement();
      }
docs: Write Border.
  
  @param XMLWriter $objWriter XML Writer
  @param Borders $pBorders Borders style