Halliday & Matthiessen (1999: 528):
The “textual” metafunction is the name we give to the systematic resources a language must have for creating discourse: for ensuring that each instance of text makes contact with its environment. The “environment” includes both the context of situation and other instances of text.