I have a number of data classes representing various entities.
Which is better: writing a generic class (say, to print or output XML) using generics and interfaces,
There's a significant performance benefit to using generics -- you do away with boxing and unboxing. Compared with developing your own classes, it's a coin toss (with one side of the coin weighted more than the other). Roll your own only if you think you can out-perform the authors of the framework.