A DTD serves the same purpose as an XML Schema, except that it contains fewer specialized types of nodes than an XML schema. The most visible difference is that an XML Schema is not defined in XML.
As a universal data format, XML provides a standard for the server-to-server transfer of different types of structured data so that the information can be decoded, manipulated, and displayed consistently and correctly. In addition, it enables the development of three-tier Web applications, acting as the data transfer format between the middle-tier Web server and the client.
An XML Schema serves the same purpose as a DTD, except that it contains more specialized types of nodes than a DTD schema. The most visible difference is that an XML Schema is defined in XML, while a DTD is not.