/** * @param bool $root * @return string */ public function pack($root = false) { $writer = new XMLWriter(); $writer->openMemory(); if ($root) { $writer->startDocument(); } $writer->startElement('order_info'); if (isset($this->headerInfo)) { $writer->writeRaw($this->headerInfo->pack()); } if (isset($this->poInfo)) { $writer->writeRaw($this->poInfo->pack()); } if (isset($this->order)) { $writer->writeRaw($this->order->pack()); } if (isset($this->printCustomerId)) { $writer->writeElement('print_customer_id', $this->printCustomerId); } $writer->endElement(); return $writer->outputMemory(); }