To be valid, every XML file you make must have a Doctype, also known as the DTD (Document Type Definition). This defines defines all the tag names, where they can be used, how often they are used, attributes, their values, whether they are required or optional, and entities you define. The Doctype can be internal, external, or a mix of both.