Using http://scalaxb.org/
<xsd:complexType name="Address">
<xsd:choice>
<xsd:element ref="ExternalAddress" />
<xsd:element ref="InternalAddress" />
</xsd:choice>
</xsd:complexType>
val internalAddrress = InternalAddress(...); // this works.
val address : Address = internalAddrress; // error: type mismatch
how do I need to modify this code to make it work?
There is some info here, and I played with DataRecord and others, but I didn't make it work. http://scalaxb.org/narrower-choice