public static XmlSchemaComplexType GetComplextType(XmlSchemaElement element) { if (element.ElementSchemaType is XmlSchemaComplexType) return element.ElementSchemaType as XmlSchemaComplexType; return null; }