Answer
Before becoming King of Germany, Henry IV was Duke of Bavaria, a position he held from 1055 to 1076. He was the son of Emperor Henry III and Agnes of Poitou, and he was the first of his family to be born in Germany. As Duke of Bavaria, Henry was responsible for governing the duchy and defending it from its enemies.