Question about optional element in instance

How can I code the Instance including "optional" element?
ie. the instance is like this.

<xforms:instance id="register">
  <client>
    <id/>
    <name>
      <first/>
      <last/>
    <sex/>
    <data/>
  </client>
</xforms:instance>

And the "name" and "sex" elements are optional.
The instance data will send to third party server,
then must pass with the following XML Schema.

<xsd:complexType name="client">
  <xsd:sequence>
    <xsd:element name="id">...</xsd:element>
    <xsd:element name="name" minOccurs="0">
      <xsd:complexType>
        <xsd:sequence>
          <xsd:element name="first">...</xsd:element>
          <xsd:element name="last">...</xsd:element>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:element>
    <xsd:element name="sex" minOccurs="0">...</xsd:element>
    <xsd:element name="date">...</xsd:element>
  </xsd:sequence>
</xsd:complexType>

--
Miyagi
 <m9467470@nirai.ne.jp>

Received on Sunday, 18 February 2007 14:55:17 UTC