API for accessing the structure of an XML document