Bayern Munich have agreed a deal to sign Mainz defender Jan Kirchhoff, penning a contract until 2016.