Sebastian Kehl struck a sweet half-volley as Borussia Dortmund secured a 3-2 win in extra-time against Hoffenheim in the German Cup.