Q:

XSD element should be only included once in tree

Given: A XML with this rough structure:
<root>
  <process name="P1">
    <variant name="V1">
    </variant>

    <variant  name="V2">
    </variant>

    <variant  name="V3">
      <startconfig>
      </startconfig>
    </variant>
  </process>

  <process name="P2">
    <variant name="V1">
      <startconfig>
      </startconfig>
    </variant>
  </process>
</root>

As you see, each process can have multiple "variants". 
How to write a XSD that makes shure that only one "startconfig" child is present below a process?

A:

XML Schema 1.0: You cannot express the constraint directly.  You could do it outside of XML Schema 1.0 via Schematron or XSLT or other programming.
XML Schema 1.1: You can use xs:assert,
<xs:assert test="count(*/startconfig) = 1"/>

as follows:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
           vc:minVersion="1.1">

  <xs:element name="root">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="process" maxOccurs="unbounded">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="variant" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="startconfig" minOccurs="0"/>
                  </xs:sequence>
                  <xs:attribute name="name" type="xs:string"/>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="name" type="xs:string"/>
            <xs:assert test="count(*/startconfig) = 1"/>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

</xs:schema>

