Validation may be done from the command line with a
dtd and a schema as shown here.
There are some variants depending on whether the schema/dtd
reference is in the XML document. The following two
examples validate with external schema/dtd:
xmllint --dtdvalid booksCanon.dtd booksCanon.xml --noout
xmllint --schema booksCanon.xsd booksCanon.xml --noout
This example validates with embedded schema/dtd:
xmllint booksCanon.xml --noout
Validation might be done from your editor/IDE directly depending on the editor.
In Windows you may install xmllint by
choco install xsltproc
In OSX, on your Mac you may install xmllint by
brew install xmlstarlet