I'm not sure exactly what you mean by the second question, but you can create objects and resources in your code, rather than in xml - this is shown in the examples. This is also covered to some extent in the code for the workshops - workshop 4 creates the object and resource for a simple temp sensor using the IPSO standard lwm2m definition.
WRT your initial question, the docs on github imply (in the section beginning "To define multiple objects,..." - I can't anchor link to this for some reason!) that you need to add a small amount of xml to contain each definition:
<!-- define object definitions here -->
I have not personally tried this though, as I tend not to use the xml method. Let me know if you have any further issues, or if I misunderstood the question!