As Rom says, there is no other solution than introducing an Objectt entity that you'll have inherit everything from, which is also a terrible solution.
Judging from what you are doing, using reflection and using a dynamically constructed xPath, this seems like it's pretty specific technical functionality. For that reason you may consider building the whole thing in Java, in which case you would not have this problem.