Ant provides targets to validate and transform XML documents.

XMLwellformed - how to use Apache ant to check an XML file for well formedness

XMLvalidate - how to use Apache ant to validate an XML file against an XML Schema

XSLT - how to use Apache ant to run an XML transform