public function withXMLBody($data, SerializationContext $context = null)
    {
        if (is_string($data)) {
            $xml = $data;
        } else {
            $xml = SerializerBuilder::create()->build()->serialize($data, 'xml', $context);
        }
        $this->addHeader('Content-Type', 'text/xml; charset=utf-8');
        $this->withBody($xml);

        return $this;
    }
public function withXMLBody($data, SerializationContext $context = null)
    {
        if (is_string($data)) {
            $xml = $data;
        } else {
            $xml = SerializerBuilder::create()->build()->serialize($data, 'xml', $context);
        }
        $this->addHeader('Content-Type', 'text/xml; charset=utf-8');
        $this->withBody($xml);

        return $this;
    }
public function withXMLBody ( $ data , SerializationContext $ context = null ) { if ( is_string ( $ data ) ) { $ xml = $ data ; } else { $ xml = SerializerBuilder :: create ( ) -> build ( ) -> serialize ( $ data , 'xml' , $ context ) ; } $ this -> addHeader ( 'Content-Type' , 'text/xml; charset=utf-8' ) ; $ this -> withBody ( $ xml ) ; return $ this ; }
Create xml with given data using serialization

@param                           $data
@param SerializationContext|null $context

@return $this
Create xml with given data using serialization