code: private function writeLayout(XMLWriter $objWriter, Layout $layout = null)
      {
          $objWriter->startElement('c:layout');
  
          if ($layout !== null) {
              $objWriter->startElement('c:manualLayout');
  
              $layoutTarget = $layout->getLayoutTarget();
              if ($layoutTarget !== null) {
                  $objWriter->startElement('c:layoutTarget');
                  $objWriter->writeAttribute('val', $layoutTarget);
                  $objWriter->endElement();
              }
  
              $xMode = $layout->getXMode();
              if ($xMode !== null) {
                  $objWriter->startElement('c:xMode');
                  $objWriter->writeAttribute('val', $xMode);
                  $objWriter->endElement();
              }
  
              $yMode = $layout->getYMode();
              if ($yMode !== null) {
                  $objWriter->startElement('c:yMode');
                  $objWriter->writeAttribute('val', $yMode);
                  $objWriter->endElement();
              }
  
              $x = $layout->getXPosition();
              if ($x !== null) {
                  $objWriter->startElement('c:x');
                  $objWriter->writeAttribute('val', $x);
                  $objWriter->endElement();
              }
  
              $y = $layout->getYPosition();
              if ($y !== null) {
                  $objWriter->startElement('c:y');
                  $objWriter->writeAttribute('val', $y);
                  $objWriter->endElement();
              }
  
              $w = $layout->getWidth();
              if ($w !== null) {
                  $objWriter->startElement('c:w');
                  $objWriter->writeAttribute('val', $w);
                  $objWriter->endElement();
              }
  
              $h = $layout->getHeight();
              if ($h !== null) {
                  $objWriter->startElement('c:h');
                  $objWriter->writeAttribute('val', $h);
                  $objWriter->endElement();
              }
  
              $objWriter->endElement();
          }
  
          $objWriter->endElement();
      }
docs: Write Layout.
  
  @param XMLWriter $objWriter XML Writer
  @param Layout $layout