The difference between the two ways, in the first method you can only create one element of this complex type, but in the second way, you can define many elements using the same type. For example :
Code:
<xs:element name="student" type="studentType" > <xs:element name=" professor " type="studentType" >