Involved in the biosynthesis of caffeine (PubMed:17401201, PubMed:17434991). Specific for xanthosine (PubMed:17434991). Cannot use xanthosine 5'-monophosphate (XMP) as substrate (PubMed:17434991). Directly produces 7-methylxanthine, and therefore the methyl transfer and nucleoside cleavage may be coupled (PubMed:17434991). Catalyzes the 7-N-methylation of xanthosine, but does not have 1-N- or 3-N-methylation activity (PubMed:17434991). S-adenosyl-L-methionine + xanthosine = 7-methylxanthosine + S-adenosyl-L-homocysteine Binds 1 Mg(2+) ion per subunit. Alkaloid biosynthesis. Homodimer. Mainly expressed in leaves and fruits (grains) (PubMed:25249475, PubMed:25190796). Also present, at lower levels, in roots, stamens and pistils (PubMed:25190796). In leaves, mostly expressed in young tissues (PubMed:25249475). In fruits, highly expressed in green grains but fades out as they are yellowing to disappear in red mature grains (PubMed:25249475, PubMed:25190796). Belongs to the methyltransferase superfamily. Type-7 methyltransferase family.