I have this XML code:

```
 <student>
    <name sex="male">
        <fname></fname>
        <lname></lname>
    </name>
</student>

```

What I want to do is to add a restriction to the `sex` attribute. `sex` attribute should only take *male* and *female* as their value.
I have basic knowledge of making this XML Schema. So far what I've done is this:

```
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="name" type="nameType"/>
    <xs:element name="fname" type="xs:string"/>
    <xs:element name="lname" type="xs:string"/>
    <xs:element name="student" type="studentType"/>

    <xs:complexType name="nameType">
        <xs:sequence>
            <xs:element ref="fname"></xs:element>
            <xs:element ref="lname"></xs:element>
        </xs:sequence>
        <xs:attribute name="sex"></xs:attribute>
    </xs:complexType>

    <xs:complexType name="studentType">
        <xs:sequence>
            <xs:element ref="name"></xs:element>
        </xs:sequence>
    </xs:complexType>
</xs:schema>

```