/** {@inheritDoc} */ public DSetCd toXml(DSet<Cd> input) throws DtoTransformException { DSetCd x = new DSetCd(); if (input != null && input.getItem() != null) { Set<Cd> sItem = input.getItem(); List<org.iso._21090.CD> tItem = x.getItems(); for (Cd cd : sItem) { org.iso._21090.CD cur = CDTransformer.INSTANCE.toXml(cd); // XSD rule: all elements of set must be non-null if (!(cur == null || cur.getNullFlavor() != null)) { tItem.add(cur); } } } if (x.getItems().isEmpty()) { x.setNullFlavor(NullFlavor.NI); } return x; }