Literature was not only a means of aesthetic expression in medieval China; it was a crucial aspect of social and political life as well. For every seemingly timeless poem by Du Fu pondering the fate of the dynasty, there were countless (now long-forgotten) verses written to impress superiors, pass the civil service exam, or simply entertain friends at a party. In spite of this crucial role played by literature, we know surprisingly little about the process by which members of the literate elite learned to produce it—that is, how they mastered a literary inheritance of historically unprecedented size and scope and put that inheritance to use in their own compositions. In this talk I examine a number of manuscripts of educational works discovered in the caves at Dunhuang to gain insight into the texts and practices of this process of literary training, analyzing both textual structures and the physical documents that contain them. Most documents date from the Tang Dynasty (618-907 CE).