Casimir I the Restorer
Ulric married Sophia, the daughter of King Béla I of Hungary and his first wife, Richeza, sister of the Polish duke Casimir I the Restorer. Alternatively, it has been suggested that she was the daughter of Béla and his second wife, Tuta of Formbach, and thereby a sister of King Ladislaus I of Hungary. Another alternative hypothesis makes her the daughter of Tuta and King Peter of Hungary, but that seems highly unlikely. Sophia had been betrothed to Margrave William of Meissen, but upon his early death in 1062 married his nephew Ulric instead. She gave her first husband four children: