StartElement branchElement = reader.peek().asStartElement();
String branchName = branchElement.getName().getLocalPart();
List<Unionbranch> branches = unionType.getUnionbranch();
for (Iterator<Unionbranch> iter = branches.iterator(); iter.hasNext();) {
Unionbranch branch = iter.next();
CorbaObjectHandler branchObj = null;
if (branch.getName().equals(branchName)) {
branchObj = readObjectFromStax(reader, branch.getIdltype(), true);
// We also need to set the discriminator since this is the branch with the actual
// union value
CorbaObjectHandler discObj =
CorbaHandlerUtils.createTypeHandler(orb, new QName("discriminator"),
unionType.getDiscriminator(), typeMaps);
obj.setDiscriminator(discObj);
// Determine the value of the discriminator.