Most of the XML manipulation functions do not have good documentation, especially xmlCreate. Supposedly it is possible to inject code into existing objects; for instance, adding code to the OnDestroy event in every ship class. However, there is no information on how to use the functions to achieve this.

I would at least want an example that demonstrates how to delete existing events from ship classes and then add new events, or how to overwrite existing events with new code

nms 15 Sep 2016:

George's documentation is here. There's not a lot of detail on the functions themselves, but there's an example and some good advice. Note that the index argument in xmlGetText is mandatory, not optional.

You might find my mods Mule Status and Auton Bay Misc Slot and Hotkey useful as examples.

Also, note that currently the game does not save the XML of types created (or redefined) using typCreate. This means that only one mod can modify the XML of a given type. This is no longer true as of 1.7B5