public function parseMailDefinition($xml, $locale = null)
    {
        $this->validator->validate($xml, $this->xsdFile);

        $parsed = simplexml_load_string($xml);

        $message = new ParsedMessage();

        $from = $parsed->from;
        if ($from->count() > 0) {
            $message->setFrom((string)$from, (string)$from->attributes()['name']);
        }

        $replyTo = $parsed->replyTo;
        if ($replyTo->count() > 0) {
            $message->setReplyTo((string)$replyTo);
        }

        foreach ($parsed->to as $to) {
            $message->addTo((string)$to, (string)$to->attributes()['name']);
        }
        foreach ($parsed->cc as $cc) {
            $message->addCc((string)$cc, (string)$cc->attributes()['name']);
        }
        foreach ($parsed->bcc as $bcc) {
            $message->addBcc((string)$bcc, (string)$bcc->attributes()['name']);
        }

        $message->setSubject($this->getLocalizedTagContent($parsed->subject, $locale));

        $message->setMessageHtml($this->getLocalizedTagContent($parsed->messageHtml, $locale));
        $message->setMessageText($this->getLocalizedTagContent($parsed->messageText, $locale));

        return $message;
    }