The XhtmlValidator is a PHP class that can be used to validate XHTML documents. It uses only the expat extension functions, which are always available in PHP, so it does not need other external XML processing extensions. The class parses the documents and checks whether the tags and attributes used by the documents are allowed within the XHTML standard. If validation errors are found, highlighted error messages and offending document line numbers will be returned.