Index: org/exolab/castor/builder/TypeConversion.java =================================================================== --- org/exolab/castor/builder/TypeConversion.java (Revision 6759) +++ org/exolab/castor/builder/TypeConversion.java (Arbeitskopie) @@ -177,8 +177,16 @@ base = (SimpleType) base.getBaseType(); } + SimpleType common = null; if (simpleType.getStructureType() == Structure.UNION) { - SimpleType common = findCommonType((Union) simpleType); + SimpleType currentUnion = simpleType; + common = findCommonType((Union) currentUnion); + while (common == null + && currentUnion.getBaseType().getStructureType() == Structure.UNION) + { + currentUnion = (SimpleType) currentUnion.getBaseType(); + common = findCommonType((Union) currentUnion); + } if (common == null) { return new XSClass(SGTypes.OBJECT); }