Invoice Size Issue

You may consolidate similar items into a single invoice line where the tax treatment is identical. The grouped line should still correctly represent the aggregated quantities, taxable amounts, discounts, and tax calculations for those items.

This approach can help reduce the overall XML size and keep the invoice within the allowed limit.

Kindly refer to following answer for more details