这对应于选择结构。您可以
@XmlElements在此用例中使用注释:
@XmlElements({ @XmlElement(name="director", type=Employee.class), @XmlElement(name="manager", type=Employee.class)})List<Employee> getEmployees() { return employees;}如果您是从XML模式开始的,那么以下内容将有所帮助:
- http://blog.bdoughan.com/2011/04/xml-schema-to-java-xsd-choice.html



