Recently, I needed to validate any XML documents within BizTalk. I tried this solution, but it was too limiting in that it required the SchemaStrongName property of the message, which, for a message of type XmlDocument, was not the actual schema's name. Since we wanted to validate against any XmlDocument message, I had to come up with another solution.

What I did was, in a helper project, reference our BizTalk schemas assembly and pre-load all the schemas in the that assembly at class load time into an XmlSchemaSet (this is a .NET 2.0 solution, there should be a similar solution for 1.1):