How to parse an XSD to get the information from <xsd:simpleType> elements using C#?
===

I have an XSD with multiple complex types and simple types (part of the file shown below). I need to  parse this document to get maxLength from each of the simpletypes that are referenced in the complex types. Can anyone please throw some advice on how to implement this? I need to implement this in a generic way so if I query on "Setup_Type" it should give the below output. Thank you!

NewSetup/Amount = 12

NewSetup/Name = 50

    <xsd:complexType name="Setup_Type">
      <xsd:sequence>
        <xsd:element name="NewSetup" type="NewSetup_Type" minOccurs="1" maxOccurs="1" />
      </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="NewSetup_Type">
      <xsd:sequence>
        <xsd:element name="Amount" type="Amount_Type"  minOccurs="1" maxOccurs="1" />
        <xsd:element name="Name" type="Name_Type"  minOccurs="1" maxOccurs="1" />
      </xsd:sequence>
    </xsd:complexType>

    <xsd:simpleType name="Amount_Type">
      <xsd:annotation>
        <xsd:documentation>Amount</xsd:documentation>
      </xsd:annotation>
      <xsd:restriction base="xsd:string">
        <xsd:maxLength value="12" />
      </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="Name_Type">
      <xsd:annotation>
        <xsd:documentation>Name</xsd:documentation>
      </xsd:annotation>
      <xsd:restriction base="xsd:string">
        <xsd:maxLength value="50" />
      </xsd:restriction>
    </xsd:simpleType>
    