code: public function marshal(Message $message, Document $document = null)
      {
          $document = $document ?: new Document();
          return $document->setData($this->doMarshal($message));
      }
docs: @param Message  $message
  @param Document $document
  
  @return Document
  
  @throws \Exception
  @throws GdbotsPbjException