If you use the search term "orm xml" or similar, you will see several posts about the XML file structure.
For example this one:
thank you very much for your reply.
Thank you very much for this information. I started doing it with nokogiri as well (before my first post).
At first glance this looks like something i could use.
I might base part of my code of yours. It is for my masters thesis, and i will of course mention you (at least in the code base.)