Check that an XML file meets the requirements of its DOCTYPE declaration

xmllint

  • XML parser and linter that supports XPath, a syntax for navigating XML trees.
    More information: <https://manned.org/xmllint>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

xmllint --valid {{source_file.xml}}

click the source code to copy install xmllint on any operating system with command-not-found.com