you have to create 50 promotions (4%, 8%, ... 100%) in XML
Not necessarily...
Think binary. You'd need a 2% and 4% to begin with, yes, but when the player has 3 unhappiness and needs a 6% boost, just give all of the units both the 2% and 4%. By combining other promotions, you can severely cut down on space taken up in the civilopedia and XML files.
Reusing that concept a couple more times, with just 5 promotions you could give the player's units up to 62% bonus, which corresponds to 31 unhappiness, and realistically unless they're the worst civ5 player known to man OR they're purposely trying to lower their unhappiness beyond rock bottom, there shouldn't be any legitimate reason for anyone to have a bonus that high. Even so, the algorithm can still be easily extended to accommodate 6 promotions for up to a 126% bonus (64 + 32 + 16 + 8 + 4 + 2), 7 promotions for up to a 254% bonus (128 + 64 + 32 + 16 + 8 + 4 + 2), 8 promotions for - without even calculation, I can guess it will be 510%, because according to the pattern, it should be the next binary number - 2. (So 9 promotions should be 1022%, right?)
This is actually a reuse of an idea UltimatePotato came up with for
dynamically adding any amount of tourism, but I think with a little simple adjustment to the bit-converting part of the lua, it should be equally applicable here.
But generally, yes, having something like this max out at some point is a good idea.