You can use an XML Validator to validate the whole XML file or parts of it. However, this feature is more appropriate while validating portions of XML streams. For validation, you need to provide the Xpath of the elements of the XML file and the path of the XSD against which the schema will validate that XML file.
Steps to create an XML Validator service
Configure > LAYOUTS > XML Validator.
Click CREATE XML Validator Layout.
On the Create Layout window, type the name and description of the new XML layout in the Name and Description fields respectively.
Select the Validate Sub XML check box if you want to validate the Sub XML.
In the Enter XPath field, enter the XPath of the XML file you want to validate.
In the XSD File Path field, enter the path of XSD file which layout will use to validate against the XML file.
Expand Advanced Properties and select the Project from the drop-down list of Project.
Click Save to save the XML Validator layout.
After creating the XML Validator service, you can place it after the source service. If the file does not match the XSD, the XML Validator service will fail and the process flow will be aborted.