Involved in the biosynthesis of caffeine (By similarity). Specific for xanthosine and could not use xanthosine 5'-monophosphate (XMP) as substrate (By similarity). Catalyzes the 7-N-methylation activity of xanthosine, but does not have 1-N- or 3-N-methylation activity (By similarity). S-adenosyl-L-methionine + xanthosine = 7-methylxanthosine + S-adenosyl-L-homocysteine Binds 1 Mg(2+) ion per subunit. Alkaloid biosynthesis. Expressed at low levels in young leaves but not in mature leaves (PubMed:25249475). Barely detectable in fruits (grains) (PubMed:25249475). Belongs to the methyltransferase superfamily. Type-7 methyltransferase family.