title: Suitable XML schema for Marshaller setSchema
body: <p>I'm having a hard time figuring out the correct schema (to validate the structure and data types) of simple <a href="http://pastebin.com/wqhbSrJK" rel="nofollow">classes</a>. For example, I could get answer for <code>Employee</code> class with <code>schemagen</code> (supplied with JDK), but still could not get it to work for <code>HumanResources</code>.</p>
  
  <p>I'm trying to serialize collection of <code>Employee</code> class instances to XML. For that, I have created class <code>HumanResources</code>, that contains a list of <code>Employee</code> class elements. Example:</p>
  
  <pre><code>    ArrayList&lt;Employee&gt; ems = getTestData();
      HumanResources hm = new HumanResources(ems);
      SchemaFactory sf = SchemaFactory.newInstance(javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI);
      JAXBContext jaxbContext = JAXBContext.newInstance(HumanResources.class);
  
      Marshaller marshaller = jaxbContext.createMarshaller();
      marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
      marshaller.setSchema(sf.newSchema(new File("src\\server\\HumanResources.xsd")));
      marshaller.marshal( new JAXBElement&lt;HumanResources&gt;(
              new QName(null, "HumanResources"), HumanResources.class, hm), os);
  </code></pre>