protected function buildMessage (array $message)
    {
        $doc = new DOMDocument();
        $root = $doc->createElement('xml');
        $doc->appendChild($root);
        
        $message = array_merge(
            $message,
            ['FromUserName' => $this->sender, 'ToUserName' => $this->recipient, 'CreateTime' => time()]
        );
        
        $this->fillElement($doc, $root, $message);
        
        return $doc->saveXML($doc->documentElement);
    }
protected function buildMessage (array $message)
    {
        $doc = new DOMDocument();
        $root = $doc->createElement('xml');
        $doc->appendChild($root);
        
        $message = array_merge(
            $message,
            ['FromUserName' => $this->sender, 'ToUserName' => $this->recipient, 'CreateTime' => time()]
        );
        
        $this->fillElement($doc, $root, $message);
        
        return $doc->saveXML($doc->documentElement);
    }
protected function buildMessage ( array $ message ) { $ doc = new DOMDocument ( ) ; $ root = $ doc -> createElement ( 'xml' ) ; $ doc -> appendChild ( $ root ) ; $ message = array_merge ( $ message , [ 'FromUserName' => $ this -> sender , 'ToUserName' => $ this -> recipient , 'CreateTime' => time ( ) ] ) ; $ this -> fillElement ( $ doc , $ root , $ message ) ; return $ doc -> saveXML ( $ doc -> documentElement ) ; }
Receives an array representation of the message, and converts it into its XML representation.

@param array $message

@return string
Receives an array representation of the message and converts it into its XML representation .