title: Invalid content was found starting with element 'employee'. One of '{contractemployee}' is expected
body: <p>I have to generate XML and XSD from an entity relationship diagram. My XML is correct but I am not able to validate the XSD i generated with this XML document as it throws up an <em>error: Invalid content was found starting with element 'employee'. One of '{contractemployee}' is expected.</em></p>
  
  <p><strong>XML:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;company&gt;
  &lt;companyname&gt;capgemini&lt;/companyname&gt;
  &lt;address&gt;mumbai&lt;/address&gt;
      &lt;department&gt;
          &lt;dname&gt;software&lt;/dname&gt;
          &lt;deptphoneno&gt;9876543210&lt;/deptphoneno&gt;
          &lt;deptfaxno&gt;0447654321&lt;/deptfaxno&gt;
          &lt;deptemail&gt;soft@capgemini.com&lt;/deptemail&gt;
              &lt;employee&gt;
                  &lt;empid&gt;101&lt;/empid&gt;
                  &lt;ename&gt;rajat&lt;/ename&gt;
                  &lt;emailid&gt;rajat@capgemini.com&lt;/emailid&gt;
                  &lt;phoneno&gt;9876543211&lt;/phoneno&gt;
              &lt;/employee&gt;
              &lt;contractemployee&gt;
                  &lt;name&gt;jade&lt;/name&gt;
                  &lt;phoneno&gt;9882507167&lt;/phoneno&gt;
              &lt;/contractemployee&gt;
      &lt;/department&gt;
  &lt;/company&gt;
  </code></pre>
  
  <p><strong>XSD:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"&gt;
      &lt;xsd:element name="company"&gt;
          &lt;xsd:complexType&gt;
          &lt;xsd:sequence&gt;
              &lt;xsd:element name="companyname" type="xsd:string"/&gt;
              &lt;xsd:element name="address" type="xsd:string"/&gt;
              &lt;xsd:element name="department"&gt;
                  &lt;xsd:complexType&gt;
                      &lt;xsd:sequence&gt;
                          &lt;xsd:element name="dname" type="xsd:string"/&gt;
                          &lt;xsd:element name="deptphoneno" type="xsd:long"/&gt;
                          &lt;xsd:element name="deptfaxno" type="xsd:int"/&gt;
                          &lt;xsd:element name="deptemail" type="xsd:string"/&gt;
                          &lt;xsd:element name="employee"&gt;
                              &lt;xsd:complexType&gt;
                                  &lt;xsd:sequence&gt;
                                      &lt;xsd:element name="empid" type="xsd:int"/&gt;
                                      &lt;xsd:element name="ename" type="xsd:string"/&gt;
                                      &lt;xsd:element name="emailid" type="xsd:string"/&gt;
                                      &lt;xsd:element name="phoneno" type="xsd:long"/&gt;
                                  &lt;/xsd:sequence&gt;
                              &lt;/xsd:complexType&gt;
                          &lt;/xsd:element&gt;
                          &lt;xsd:element name="contractemployee"&gt;
                              &lt;xsd:complexType&gt;
                                  &lt;xsd:sequence&gt;
                                      &lt;xsd:element name="name" type="xsd:string"/&gt;
                                      &lt;xsd:element name="phoneno" type="xsd:long"/&gt;
                                  &lt;/xsd:sequence&gt;
                              &lt;/xsd:complexType&gt;
                          &lt;/xsd:element&gt;
                      &lt;/xsd:sequence&gt;
                  &lt;/xsd:complexType&gt;
              &lt;/xsd:element&gt;
          &lt;/xsd:sequence&gt;
      &lt;/xsd:complexType&gt;
  &lt;/xsd:element&gt;
  &lt;/xsd:schema&gt;
  </code></pre>