XML is a markup language that organizes data in a readable format for both humans and machines. It allows data to be stored, exchanged, and distributed over the internet independently of applications. XML has tags that are self-descriptive and extensible, allowing authors to define their own tags. XML documents have a hierarchical, tree-like structure with elements that can contain text, attributes, comments, and other nested elements. Attributes provide additional data about elements, and there are rules for properly structuring tags, elements, and attributes in XML documents.