My goal is that it reads the file once and depending on what the classname is, an object (or multiple objects) of that class are created for my game.
The problem that I have, is that every class has different variables. For example: My "player" class has a start position and a color but my "Healthpickup" class has a Health variable. So I can't think of some kind of an algorithm that would work in every case.
I made a solution already but in that case, for every variable that is in the text file, the text file is read again and again.
(I could do: GetValue(L"Player"), (L"StartPosition"))
But that is not efficient at all.
Is there a reason for the unusual XML-like format you have chosen? If you don't care how the data is stored, I would recommend using JSON: http://www.json.org/