As an additional benefit, many XML parsers also check if the XML document is well formed and if it is valid. However, the main purpose of an XML parsers is not to check and validate XML documents because this is what XML validators are for. This is why one of the frequent classifications of XML parsers is into validating and non-validating.
Validating XML parsers not only check if the document is well-formed but they also check if it conforms to a specific DTD (Document Type Definition). The DTD can be internal or external. Validating XML parsers are especially useful when you use your custom DTD because they will check for you if your XML conforms to the custom DTD.
Non-validating XML parsers are simpler. They don't check the validity of your XML against a DTD – they just check if the XML is well-formed or not.
XML parsers are language-specific. Some of the most popular XML parsers are written in Java and their advantage is that they can be deployed on any platform. However, there are XML parsers in almost any programming language, such as PHP, C, perl, Python, etc. Actually, almost any vendor who has anything to do with XML offers an XML parser and very often these XML parsers are free even for commercial use.