下記のような XML インスタンスに対する Schema を考えます。
<root>
<sub1>
<child1>aaa</child1>
<child2>bbb</child2>
<child3>ccc</child3>
</sub1>
<sub2>
<child1>aaa</child1>
<child2>bbb</child2>
<child3>ccc</child3>
<child4>ddd</child4>
</sub2>
</root>
まず、このような XML Schema ができあがりました。
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="root">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="sub1" type="sub1Type"/>
<xsd:element name="sub2" type="sub2Type"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="sub1Type">
<xsd:sequence>
<xsd:element name="child1" type="xsd:string"/>
<xsd:element name="child2" type="xsd:string"/>
<xsd:element name="child3" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="sub2Type">
<xsd:sequence>
<xsd:element name="child1" type="xsd:string"/>
<xsd:element name="child2" type="xsd:string"/>
<xsd:element name="child3" type="xsd:string"/>
<xsd:element name="child4" type="xsd:string"/>
</xsd:sequence>
</xsd:schema>
sub2Type と sub1Type は重複している部分がありますね。
こんな場合、sub2Type を sub1Type の拡張として定義できます。
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="root">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="sub1" type="sub1Type"/>
<xsd:element name="sub2" type="sub2Type"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="sub1Type">
<xsd:sequence>
<xsd:element name="child1" type="xsd:string"/>
<xsd:element name="child2" type="xsd:string"/>
<xsd:element name="child3" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="sub2Type">
<xsd:complexContent>
<xsd:extension base="sub1Type">
<xsd:sequence>
<xsd:element name="child4" type="xsd:string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>
こんな感じです。
ここで、XML インスタンス文書が下記のように変更されたとしましょう。
<root>
<sub1>
<child0>---</child0>
<child1>aaa</child1>
<child2>bbb</child2>
<child3>ccc</child3>
</sub1>
<sub2>
<child0>---</child0>
<child1>aaa</child1>
<child2>bbb</child2>
<child3>ccc</child3>
<child4>ddd</child4>
</sub2>
</root>
すると XML Schema は下記のようになります。
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="root">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="sub1" type="sub1Type"/>
<xsd:element name="sub2" type="sub2Type"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="sub1Type">
<xsd:sequence>
<xsd:element name="child0" type="xsd:string"/>
<xsd:element name="child1" type="xsd:string"/>
<xsd:element name="child2" type="xsd:string"/>
<xsd:element name="child3" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="sub2Type">
<xsd:complexContent>
<xsd:extension base="sub1Type">
<xsd:sequence>
<xsd:element name="child4" type="xsd:string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>
ようするに、1 箇所変更するだけで対処できますよということです。
一番最初に示した Schema だと 2 箇所変更する必要があります。
xsd:sequence 以外にもxsd:all, xsd:choice などが使えますし、もちろん属性の追加もできます。
ただし、最後にしか追加することはできません。