Current implementation of the method serializes with the same code variant and set properties which is wrong.
The code
tkVariant, tkSet: begin
aTargetNode.Value := GetVariantProp(anObject, lName);
end;
should be modified to:
tkVariant: begin
aTargetNode.Value := GetVariantProp(anObject, lName);
end;
tkSet: begin
aTargetNode.Value := GetSetProp(anObject, lName);
end;