Khedira played as a DM for all his life till he moved to Madrid. Don't forget when he broke through in 2010 world cup he was playing as a defensive midfielder for Germany too. Can definitely do a job there and strike a good balance with Ramsey of when to go forward.
I really can't see Madrid selling him though, I know they are insane and signing Kroos. But surely they might let Illaramendi go first or even Isco? Ancelotti love Khedira.