public void setMixed(boolean isMixed) { String textAttribute = "text"; XMLDirectMapping textMapping = (XMLDirectMapping) xmlDescriptor.getMappingForAttributeName(textAttribute); if (isMixed) { if (null == textMapping) { textMapping = new XMLDirectMapping(); textMapping.setAttributeName(textAttribute); textMapping.setXPath("text()"); xmlDescriptor.addMapping(textMapping); } } else { xmlDescriptor.removeMappingForAttributeName(textAttribute); } }