XmlSchemaImport FindImport(XmlSchema schema, string ns) { foreach (object item in schema.Includes) { if (item is XmlSchemaImport) { XmlSchemaImport import = (XmlSchemaImport)item; if (import.Namespace == ns) { return import; } } } return null; }