Suppose in XSD we have an element 'answer' defined:
<xs:element name="answer" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:attribute name="name" use="required">
<xs:simpleType>
<xs:restriction base="answer"/>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
in the same document we have an element 'language' defined as:
<xs:element name="language" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:attribute name="name" use="required">
<xs:simpleType>
<xs:restriction base="answer"/>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
Both of these have an entry <xs:restriction base="answer"/>
where the "answer" is an enumeration of predefined values.
So, I need to validate that if exists the "answer" node with name = 'some_answer' there is also exists the "answer" node with name = 'some_answer'
Example:
<answer name="some_answer"/>
<language name="some_answer"/>