This is still a WIP, but the main idea is there. Feel free to contribute!
At the moment, there is no way to convert into binary directly. If anyone wants to help figuring out, feel free to post a pull request. For now, you need to convert it manually with the ScriptData menu of BeardLib Editor. From custom_xml to binary.