}
private void writeElement(JAXBObjectBuilder builder, JBlock block, ElementMapping mapping, JVar itemVar, Class type, boolean nillable, boolean xmlList) {
// if this is an id ref we write the ID property of the target bean instead of the bean itself
if (mapping.getProperty().isIdref()) {
Property property = mapping.getProperty();
Property idProperty = findReferencedIdProperty(property);
// read the id value
itemVar = getValue(builder, itemVar, idProperty, property.getName() + JavaUtils.capitalize(idProperty.getName()), block);
// the written type is always a non-nillable String
type = String.class;
nillable = false;