XML is a markup language that allows users to define their own tags. It was created to describe data rather than display it like HTML. XML uses tags to provide context and meaning to data. Documents must follow specific rules to be considered well-formed, such as having matching start and end tags. Documents can also specify a document type definition (DTD) or schema to add additional structure and validation.