Involved in the biosynthesis of caffeine. Catalyzes the conversion of 7-methylxanthine (7mX) to theobromine and with a lower activity of paraxanthine to caffeine. 7-methylxanthine + S-adenosyl-L-methionine = H(+) + S-adenosyl-L-homocysteine + theobromine Binds 1 Mg(2+) ion per subunit. Alkaloid biosynthesis. Belongs to the methyltransferase superfamily. Type-7 methyltransferase family.