The development of XML technology has occurred very rapidly, initially leaving theory behind. As is often the case in such situations, practical development sometimes seemed more ad-hoc than well principled. There is now a substantial body of work providing formal foundations for XML. This paper presents a personal perspective on some recent developments in the theory of XML.