Grammar-based validation languages, such as XML Schema and DTD, are well equipped to ensure that XML documents conform to a well-defined message structure. This ensures that incoming XML messages can be processed correctly by the receiving applications, but it does not ensure that the data contained in the messages is valid. The limitations of grammar-based validation languages mean that, for example, you have to validate co-occurrence constraints and constraints against variable and external data sets using different methods.