Complex sentence: Ludwig then took to wife Ludmilla of Bohemia in 1204 to gain the alliance of her uncle Ottokar I of Bohemia.
Split into simpler sentences: Ludwig then took to wife Ludmilla of Bohemia in 1204. This marriage granted him alliance with her uncle Ottokar I of Bohemia.