XML Schema - groups use

Example of elements/attributes groups use:

<xs:complexType name="bookType"> 
 <xs:sequence>
  <xs:group ref="mainBookElements"/>
  <xs:element name="character" type="characterType" minOccurs="0" maxOccurs="unbounded"/>
 </xs:sequence>
 <xs:attributeGroup ref="bookAttributes"/>
</xs:complexType>