At the beginning of the Tang era there was a monk called Xuanzang who went to the western regions and brought scriptures, in a single journey of seventeen years. On the day of his departure, in the Lingyan Monastery in Qizhou, a pine stood in the courtyard, and Zang touched his hand to its branches, saying: “I go west to seek the teachings of the Buddha; you should grow to the west; if I return, these twigs should face east: let my pupils and disciples know of it.” When he left, the branches pointed westward year by year, growing several zhang (c. 3.3m). One day, they were suddenly pointed to the east, and his pupils and disciples said: “The Master has returned.” They thus went west to greet him. Zang had indeed returned, and obtained six hundred volumes of Buddhist scriptures. To this day people still call it ‘the ordained pine’.
Li Rong 李冗, Du yi zhi 獨異志 (Outstanding Fantastic Stories), 上1.17 (Tale 86):
Li Rong 李冗, Du yi zhi, 獨異志 (Outstanding Fantastic Stories) in Du yi zhi, Xuanshi Zhi 獨異志，宣室志 (Outstanding Fantastic Stories, Stories from the Chamber of Dissemination), edited by Zhang Yongqin 张永钦 and Hou Zhiming 侯志明 (Beijing: Zhonghua shuju, 1983)
An account in the Taiping Guangji pairs this story with a tale describing an incident during Xuanzang’s journey:
The Śramaṇa (Buddhist ascetic) Xuanzang’s secular surname was Chen, and he was from Yanshi County. As a youth he was intelligent, and studious in behaviour. At the beginning of the Tang Wude era (618-26 CE), he went to the Western Regions to fetch scriptures. When he reached the Kubhā realm, the road became perilous, with tigers and leopards he could not pass. Zang did not know what to do, so he locked himself into a room and sat. When night came he opened the door, and saw an elderly monk, whose head and face bore sores and wounds, and body showed discharge and blood. Sitting alone on the bed, he had no idea from where he had come; Zang therefore bowed courteously and diligently sought his help. The monk dictated a section of the Duoxinjing (the Prajñā-Pāramitā Hrdaya Sūtra), and ordered Zang to recite it. He then found that the landscape broadened and flattened, and the road opened up, the wild beasts hiding themselves, and the monsters retreating into concealment, allowing him to reach the land of the Buddha. He took six hundred works of scripture and returned, and his Prajñā-Pāramitā Hrdaya Sūtra is recited to this day. At the beginning, when Zang was about to depart for the Western Regions, there was a pine tree in the Lingyan Monastery, and Zang, standing in the courtyard, touched its branches with his hand and said: “I am going west to seek the Buddha’s teachings. You should grow to the west, and if I return, you should stop and turn to the east, so that my disciples can be informed.” He then left. Its branches then grew westward as year followed year, reaching several zhang in length (a zhang is c. 3.3m). One year it suddenly turned back around. His disciples said: “The Master has returned!” They then went west to greet him, and Zang had indeed come back. To this day people still call it the ‘ordained pine.’ Taken from Duyizhi and Tangxinyu.
Li Fang 李昉, et al., Taiping guangji 太平廣記 (Extensive Gleanings from the Era of Great Harmony), 10 vols (Beijing: Zhonghua shuju, 1961), ii, 92.606:
 The late Glen Dudbridge states that this was a pine twig planted by Xuanzang, rather than an extant tree standing in the courtyard when he visited; I don’t see this reading in either version (but am happy to be corrected). See Glen Dudbridge, The “Hsi-yu Chi”: A Study of Antecedents to the Sixteenth-Century Chinese Novel (Cambridge: Cambridge University Press, 1970), p. 22.
 On the term Śramaṇa, see https://en.wikipedia.org/wiki/%C5%9Arama%E1%B9%87a.
 The phrase 虎豹could also refer to violent people.