...
Actually xpfStringToEnumeration (1) does not convert to a string to an aggregate, but returns enumeration element value and (2) expects not id of target model, but id of target enumeration, that could be received e.g. in call to xpfGetDefinedType, like the following:
enum_id := xpfGetDefinedType(XPXTARGETMODELID, enum_name);
...