As far as I saw, units always heal up to full strength when stationed in a city for some well-deserved R&R.
Combining units would be great but poses a rat's ass full of problems.
Units are not just a number, they have eqipment. The numbers then come from the equipment.
A simple and intuitive system to combine 4 experienced single soldiers into one squad of 4 would be... tricky.
The XP part is simple enough. Just take the average and deduct a few % to represent the unit "having to learn to work together" or something to that effect.
The only way the equipment upgrades could work is that only those pieces of equipment that are present on all combined units, would go to the final unit.
Weapons are obviously tricky because they aren't necessarily good and bad weapons (so take the worst one for all) but different. The swords add combat speed, the hammers lower it but do more damage. Different concepts.
Upgrading units would have to be a completely separate step.
It may not look like a different step on the responsible UI but once the "semi-naked" units have been combined into a squad, they would all be identical soldiers and the price/resources for upgrading them to a different squad of identical soldiers could be calculated.
That's no different from upgrading shiptype A to shiptype B in GalCiv.