A mixed complex type can contain attributes, elements, and text.
Complex Type with Mixed Content
The XML element "letter" contains text and other elements:
The following schema declares the "letter" element:
Note: To allow character data to appear between the child elements of "letter", the mixed attribute must be set to "true". The <xs:sequence> tag (name, orderid, and shipdate) means the defined elements must appear in sequence within the "letter" element.
We can also give the complexType element a name and let the type attribute of the "letter" element reference this name of the complexType (this way, multiple elements can reference the same complex type):