public function toNode(DOMDocument $document = null)
    {
        if (null === $document) {
            $document = new DOMDocument();
        }

        $node = $document->createElement('Notification');

        $node->appendChild($document->createElement('NotificationCode', $this->getNotificationCode()));
        if ($this->getEmailMessage() !== null) {
            $node->appendChild($this->emailMessage->toNode($document));
        }
        if ($this->getLocale() !== null) {
            $node->appendChild($this->locale->toNode($document));
        }

        return $node;
    }
public function toNode(DOMDocument $document = null)
    {
        if (null === $document) {
            $document = new DOMDocument();
        }

        $node = $document->createElement('Notification');

        $node->appendChild($document->createElement('NotificationCode', $this->getNotificationCode()));
        if ($this->getEmailMessage() !== null) {
            $node->appendChild($this->emailMessage->toNode($document));
        }
        if ($this->getLocale() !== null) {
            $node->appendChild($this->locale->toNode($document));
        }

        return $node;
    }
@param null|DOMDocument $document

@return DOMElement