In Chapter 1, we explained the motivation behind xml data and statement formatting, outlined the basic structure of an xml document, and discussed possible applications. In this chapter, we summarize the basic xml grammar and illustrate the implementation of a document type definition (dtd) or xml schema definition (xsd) for the purpose of document validation. We recall that validation is necessary only when an xml document structure is required to conform with agreed conventions.