private XmlSchemaSet CompileSchemaSet(string xsd)
{
XmlSchemaSet schemaSet = new XmlSchemaSet();
schemaSet.XmlResolver = new XmlUrlResolver();
schemaSet.Add(XmlSchema.Read(new StringReader(xsd), OnValidationEvent));
schemaSet.ValidationEventHandler += OnValidationEvent;
schemaSet.Compile();
return schemaSet;
}