/**
  * @param string $verb
  * @param mixed $xml - XML encoded array or XML string
  * @return array - request response
  */
 protected function invokeXml($verb, $xml)
 {
     if (is_array($xml)) {
         $XArray = new XArray($xml);
         $xml = $XArray->toXml();
     }
     // @note (guerrics): adding empty check since dream dies on empty xml bodies
     $contentType = !empty($xml) && empty($this->headers[self::HEADER_CONTENT_TYPE]) ? 'application/xml' : null;
     return $this->invoke($verb, $xml, $contentType);
 }
 /**
  * @param string $key
  * @return string
  */
 public function getXml($key = '')
 {
     if ($key == '') {
         return $this->toXml();
     }
     $val = $this->getVal($key, null);
     $XArray = new XArray($val);
     return $XArray->toXml();
 }