Node entityMgrRefNode = appendChild(parent, nodeName);
writeLocalizedDescriptions(entityMgrRefNode, descriptor);
appendTextChild(entityMgrRefNode, TagNames.PERSISTENCE_CONTEXT_REF_NAME, descriptor.getName());
appendTextChild(entityMgrRefNode, TagNames.PERSISTENCE_UNIT_NAME, descriptor.getUnitName());
PersistenceContextType contextType = descriptor.getPersistenceContextType();
String contextTypeString = (contextType != null &&
PersistenceContextType.EXTENDED.equals(contextType)) ?
EXTENDED : TRANSACTION;
appendTextChild(entityMgrRefNode, TagNames.PERSISTENCE_CONTEXT_TYPE,
contextTypeString);