Almost all the enumerations in Intel XED are automatically generated and have conversion functions to and from strings. There is also a function for finding out what the last element of the enumeration is.