Investors & landlords

If you did this all through one broker and had no positions in that security by Dec 27, 2017, your broker should do all the accounting for cost basis adjustment of replacement shares on your consolidated 1099-B. This is required. It should all work out in the end

There is nothing for you to do but report the consolidated 1099-B as supplied to you. 
Reporting the wash sales as shown is also required.

If you still have a position in XYZ at the end of the year, you might not recover that disallowed loss in 2017.