Answer:
When a company engages in a non-monetary exchange lacking commercial substance, it must record the acquired asset at the same carrying value as the exchanged asset.
ABC's journal entry:
Dr Cash 25,000
Dr Building - new 75,000
Dr Accumulated depreciation building - old 60,000
Cr Building - old 150,000
Cr Gain on the exchange 10,000*
Since the amount of money received is less than 25% of total consideration, the company must recognize a partial gain corresponding only to the cash received. The partial gain is calculated by subtracting the cash received from the fair market value of the asset. In this case, the FMV was $100,000, and the carrying value was 90,000, so the recognized gain must equal $100,000 - $90,000 = $10,000. Then you must adjust the new carrying value to match the FMV - cash ($100,000 - $25,000 = $75,000).
XYZ's journal entry:
Dr Building - new 105,000
Dr Accumulated depreciation building - old 15,000
Cr Building - old 95,000
Cr Cash 25,000
Since the transaction lacked commercial substance and XYZ didn't receive any cash, it mus record the new value of the new building by adding the carrying value of the old building plus the boot money paid to ABC (= $80,000 + $25,000 = $105,000).