The XMLRelation function takes XML documents and outputs their element names, attribute values, text, and structural information in a relational table, which you can search with SQL queries. The function maintains multilevel paths from the input XML documents to the XML elements.