Attachments = array();   if (strstr($headers['content-type'], 'multipart/related')) {    $this->debug('Decode multipart/related');    $input = '';    foreach ($headers as $k => $v) {     $input .= "$k: $v\r\n";    }    $params['input'] = $input . "\r\n" . $data;    $params['include_bodies'] = true;    $params['decode_bodies'] = true;    $params['decode_headers'] = true;        $structure = Mail_mimeDecode::decode($params);     foreach ($structure->parts as $part) {     if (!isset($part->disposition) && (strstr($part->headers['content-type'], 'text/xml'))) {      $this->debug('Have root part of type ' . $part->headers['content-type']);      $r