Well, that is a very common problem. The solution to your problem is use a method that is both consistent and captures your true cost basis.
The method used frequently is as follows;
1. Computation of basis.
Lets say you bought 100 shares of ABC at the following prices for the 3 different lots,
-20 @$9....($180 purchase cost)
-30 @$10..($300 purchase cost) and
-50 @$11..($550 purchase cost)
This results in total purchase of 100 shares for a total basis (purchase) price of $1,030. This results in an average cost price of $10.30 per share.
2.Basis of XYZ.
Since ABC was acquired by XYZ, though your basis remains the same, but the number of shares were exchanged for 4 for 1. Thus, original shares were replaced with only 25 new shares of XYZ, and so your cost per share of XYZ is increased 4 times.
Hence XYZ basis = $1,030 / 25 shares
cost per share = $41.20
Using my example substitute your true purchase price and you will arrive at cost per share for each new acquired XYZ share.
This is can be very complicated, but try keep it simple by using a method that captures your true basis. Also, you can use the average cost method to calculate the basis for the newly acquired shares.
Generally speaking, you have to use first in first out method for individual lots, but in this instance you can use the average method. I hope this helps bring some better understanding in this problem.