Separate <add> XML fragment creation into interface.

Separate `<add>` XML fragment creation into interface, which compatibility layers can implement to indicate they want to generate the `<add>` fragment.

Different solution for #7 as implemented in #8 to maintain backwards compatibility.