This is an uncontrolled string, with an optional type attribute - also uncontrolled.
This is a convenience datatype. There are many cases in which an element has a value, and a type attribute to help qualify that value. For example, a postal code with a type value, such as ZIP code. Or a well name, with a type attribute. If the type attribute is to be required, use the reqTypeType datatype. If the type attribute is to be restricted in its values, it is best to develop it separately.
<xsd:complexType name="optTypeType">
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="type" type="xsd:string" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<element name="wellName" type="optTypeType"/>
<wellName type="local field">Bojangles #6</wellName>