Instead of using
CreateElement((i).ToString());
Use
CreateElement((tagName));
Where tagName could be for example FirstName or LastName, so it ends up in the XML tag as
<firstname></firstname>
To do this in the simplest way, create an array of fields holding literal strings like this:
string[] fields = {"FirstName", "LastName", "Id"};
Replace the
(i).ToString()
with
fields[i]
This should solve your problem.