• You could try to change the DISTINCT with GROUP BY. That might force it to eliminate duplicates before creating the XMLs (although, it doesn't seem like you need the DISTINCT at all).
    The query is not complete, but I would suggest that you also try something like this:

    SELECT IncidentReportIDs
    FROM cmp.NotificationProduct NP

    INNER JOIN(SELECT
          A.CompanyNotificationId,

          (SELECT DISTINCT IR.IncidentReportId, IR.DocumentNumber, IR.ReceivedDate
          FROM cmp.NotificationProduct NP
          INNER JOIN irp.IncidentProduct IP ON NP.IncidentProductId = IP.IncidentProductId
          INNER JOIN irp.IncidentReport IR ON IR.IncidentReportId = IP.IncidentReportId
          LEFT JOIN irp.IncidentCompanyBlocked ICB ON IR.IncidentReportId = ICB.IncidentReportId
          WHERE A.CompanyNotificationId = NP.CompanyNotificationId
          AND ICB.IncidentReportId is null
          AND NP.CompanyNotificationId IS NOT NULL
          FOR XML PATH('IncidentReport'), root('List')) AS 'IncidentReportIDs'
       FROM cmp.CompanyNotification A
       GROUP BY A.CompanyNotificationId
    ) E ON NP.CompanyNotificationId = E.CompanyNotificationId
    WHERE ICB.IncidentCompanyBlockedId IS NULL
    UNION ALL
    SELECT BlockedIncidentReportID
    FROM cmp.NotificationProduct NP
    INNER JOIN(SELECT
          A.CompanyNotificationId,
          (SELECT DISTINCT IR.IncidentReportId, IR.DocumentNumber, IR.ReceivedDate
          FROM cmp.NotificationProduct NP
          INNER JOIN irp.IncidentProduct IP ON NP.IncidentProductId = IP.IncidentProductId
          INNER JOIN irp.IncidentReport IR ON IR.IncidentReportId = IP.IncidentReportId
          LEFT JOIN irp.IncidentCompanyBlocked ICB ON IR.IncidentReportId = ICB.IncidentReportId
          WHERE A.CompanyNotificationId = NP.CompanyNotificationId
          AND ICB.IncidentReportId is not null
          AND NP.CompanyNotificationId IS NOT NULL
          FOR XML PATH('IncidentReport'), root('List')) AS 'BlockedIncidentReportID'
       FROM cmp.CompanyNotification A
       GROUP BY A.CompanyNotificationId

    ) E ON NP.CompanyNotificationId = E.CompanyNotificationId
    WHERE ICB.IncidentCompanyBlockedId IS NOT NULL;

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2