Man you're the boss.
It works perfect. Now i can generate from the xml file.
The chapters If i do manually they work.
The offset still necessary, i send you the book so you can test it.
I only find one problem with the xml file origin, if i use special characters the xmray ouput its invalid. For example in spanish we use áéíóúÁÉÍÓÚüÜ probably also with ñÑ, if i put one of those the result is invalid. I see in notepad that a very strange character it's used. For example: "Médico" and the result in the xray is "M
xE9dico" If i change back the word to "Médico" editing directly in the xray thhen works. It's a problem from the xml source reading and writing in a strange way.
Now the gui version is almost perfect