public static XmlValidator LoadFromManifestResource(Assembly resourceOwner, string manifestResourceName)
{
if (manifestResourceName == null)
throw new ArgumentNullException("manifestResourceName");
if (resourceOwner == null)
throw new ArgumentNullException("resourceOwner");
Stream stream = resourceOwner.GetManifestResourceStream(manifestResourceName);
if (stream == null)
throw new ArgumentException(String.Concat("Resource is not found. Assembly: ", resourceOwner.FullName, ", Resource name: ", manifestResourceName));
XmlValidator schema = new XmlValidator();
schema.LoadSchema(stream);
return schema;
}