Original: In 1003, she was married to King Robert, after his divorce from his second wife, Bertha of Burgundy.
Simplified: They were married in 1003 after Robert had got a divorce from his second wife, Bertha.