Have you seen this example ? It shows how to use QXmlSchema to validate xml document based on predefined schema.