title: Generate a well formatted XML Structure
body: <p>XYZ school wants to store the details of students and staff in an XML file. The following scenario helps in designing the XML document:</p>
  <p><code>persons</code> will be the root tag.</p>
  <p><code>persons</code> will have the entry of each person with name, age, gender, address.</p>
  <p>A person can be either a student or staff.</p>
  <p>student will have rollno, standard and section.</p>
  <p>If staff, then staffid and subject.</p>
  <p>Every person must have an address with the following entry- doorno,    street,city and state.</p>
  <p>I created following XML Structure for the same statement:</p>
  <pre><code>&lt;xs:schema xmlns:xs=&quot;http&quot;&gt;
     &lt;xs:element name=&quot;persons&quot;&gt;
        &lt;xs:complexType&gt;
           &lt;xs:sequence&gt;
              &lt;xs:element name=&quot;person&quot;&gt;
                 &lt;xs:complexType&gt;
                    &lt;xs:sequence&gt;
                       &lt;xs:element name=&quot;name&quot; type=&quot;xs:string&quot; /&gt;
                       &lt;xs:element name=&quot;age&quot; type=&quot;xs:integer&quot; /&gt;
                       &lt;xs:element name=&quot;gender&quot; type=&quot;xs:string&quot; /&gt;
                       &lt;xs:element name=&quot;address&quot;&gt;
                          &lt;xs:sequence&gt;
                             &lt;xs:element name=&quot;doorno&quot; type=&quot;xs:integer&quot; /&gt;
                             &lt;xs:element name=&quot;street&quot; type=&quot;xs:string&quot; /&gt;
                             &lt;xs:element name=&quot;city&quot; type=&quot;xs:string&quot; /&gt;
                             &lt;xs:element name=&quot;state&quot; type=&quot;xs:string&quot; /&gt;
                          &lt;/xs:sequence&gt;
                       &lt;/xs:element&gt;
                       &lt;xs:element name=&quot;student&quot; minOccurs=&quot;0&quot;&gt;
                          &lt;xs:complexType&gt;
                             &lt;xs:sequence&gt;
                                &lt;xs:element name=&quot;rollno&quot; type=&quot;xs:integer&quot; /&gt;
                                &lt;xs:element name=&quot;standard&quot; type=&quot;xs:integer&quot; /&gt;
                                &lt;xs:element name=&quot;section&quot; type=&quot;xs:string&quot; /&gt;
                             &lt;/xs:sequence&gt;
                          &lt;/xs:complexType&gt;
                       &lt;/xs:element&gt;
                       &lt;xs:element name=&quot;staff&quot; minOccurs=&quot;0&quot;&gt;
                          &lt;xs:complexType&gt;
                             &lt;xs:sequence&gt;
                                &lt;xs:element name=&quot;staffid&quot; type=&quot;xs:integer&quot; /&gt;
                                &lt;xs:element name=&quot;subject&quot; type=&quot;xs:string&quot; /&gt;
                             &lt;/xs:sequence&gt;
                          &lt;/xs:complexType&gt;
                       &lt;/xs:element&gt;
                    &lt;/xs:sequence&gt;
                 &lt;/xs:complexType&gt;
              &lt;/xs:element&gt;
           &lt;/xs:sequence&gt;
        &lt;/xs:complexType&gt;
     &lt;/xs:element&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  <p>Above code is giving me an error and I am unable to solve that error. Please help!
  Error is cannot find the declaration of element 'xs:schema'.</p>