Decoding XML and the DTD
This introductory article shows how to create XML Document Type Definitions (DTDs) and well-formed, well-defined XML files that can be validated by the XML parser of your choice. While you don't have to include a DTD with every XML file you produce, doing so will make your life a lot easier. Not only will a DTD enforce the syntax you've established for your XML files, it will also allow your files to be parsed by a validating XML parser. Code samples include DTD and XML document examples.