 Taoism , in form of the Shangqing school , gained official status in China again during the Tang dynasty ( 618 – 907 ) , whose emperors claimed Laozi as their relative . The Shangqing movement , however , had developed much earlier , in the 4th century , on the basis of a series of revelations by gods and spirits to a certain Yang Xi in the years between 364 and 370 . 
