My problem is, the MyClass in my example is a auto-generated JAXB class which i won't change and i'm trying to create a generic method to fill in different JAXB classes. Theses classes have exactly one set method according to an XML element. So i need to now the arguments type.