Given the following in C#:
[Flags] public enum MyFlags { None = 0, First = 1 << 0, Second = 1 << 1, Third = 1 << 2, Fourth = 1 <&l
You're better off populating a Dictionary or a Typed DTO and serializing that.
Dictionary