First of all, Things are not defined in XML files, they are defined in .things files which have their own format. This alone indicates you either have little understanding about how OH works or you are using the wrong vocabulary.
Secondly, that is what Autodiscovery is for. When you install a 2.x version binding you can go to the inbox and the binding will go out and try to discover the devices that the binding supports and it will automatically create the Things for those devices.
But if you need to manually create a Thing, you can also go to the Things page under Configuration and press the blue and white + icon and manually define a Thing.
thanks for the fast reply. However, my question is not about adding things within e.g. PaperUI, but
implementation of specific things via Java within a binding.
I am able to configure a thing incl. channels within things.xml. However, I would like to generate things e.g. with a dynamic number of channels.
I would assume that there is a possibility to implement this directly in Java without xml files.
Can you provide me some further links on this topic?