private static function _createNotificationForNotificationType(
        Message $ipnMsg,
        $xmlDocumentElement
    ) {           
        // Construct an instance of the notification class
        switch ($ipnMsg->getMandatoryField("NotificationType")) {
        case "OrderReferenceNotification":
            $notification
                = new OffAmazonPaymentsNotifications_Model_OrderReferenceNotification(
                    $ipnMsg->getNotificationMetadata(),
                    $xmlDocumentElement
                );
            break;
        case "BillingAgreementNotification":
            $notification
                = new OffAmazonPaymentsNotifications_Model_BillingAgreementNotification(
                    $ipnMsg->getNotificationMetadata(),
                    $xmlDocumentElement
                );
            break;
        case "PaymentAuthorize":
            $notification
                = new OffAmazonPaymentsNotifications_Model_AuthorizationNotification(
                    $ipnMsg->getNotificationMetadata(),
                    $xmlDocumentElement
                );
            break;
        case "PaymentCapture":
            $notification
                = new OffAmazonPaymentsNotifications_Model_CaptureNotification(
                    $ipnMsg->getNotificationMetadata(),
                    $xmlDocumentElement
                );
            break;
        case "PaymentRefund":
            $notification
                = new OffAmazonPaymentsNotifications_Model_RefundNotification(
                    $ipnMsg->getNotificationMetadata(),
                    $xmlDocumentElement
                );
            break;
        default:
            throw new OffAmazonPaymentsNotifications_InvalidMessageException(
                "Error with IPN notification - unknown notification " .
                $ipnMsg->getMandatoryField("NotificationType")
            );
        }
        
        return $notification;
    }