XMLStarlet has a validate subcommand. At its simplest, to check for well-formedness:
xmlstarlet val "$filename"
To validate against a DTD:
xmlstarlet val -d "$dtd_filename" "$xml_filename"
To validate against an XSD schema:
xmlstarlet val -s "$xsd_filename" "$xml_filename"
To validate against a RelaxNG schema:
xmlstarlet val -r "$rng_filename" "$xml_filename"
This isn't built into bash -- bash has no built-in XML parser, and validation cannot be performed without one -- but it is widely packaged for modern OS distributions.
XMLStarlet also has subcommands for extracting information from XML files, editing XML files, etc. If you're going to be working with XML from shell scripts, its use is well-advised.