plone/plone.recipe.zope2instance — pull request #13 by lukasgraf (2014-03-21 11:27:40+00:00)
Title: Always wrap contents of zcml-additional with a <configure /> node.

This makes it possible to use `+=` assignments with `zcml-additional`.

Currently, the contents of `zcml-additional` are dumped as-is in `999-additional-overrides.zcml`. This means that you can't use `zcml-additional +=` assignments to add to an instance's additional ZCML from multiple places, because you will end up with a `999-additional-overrides.zcml` that contains multiple top level nodes (which isn't valid XML).

In this PR I wrap the contents of `zcml-additional` in `` node (including the Zope XMLNS) before writing them to the file.

This is done unconditionally, so even if `zcml-additional` only contains one element, it will be wrapped. However, because `` directives can be nested to arbitrary depths (see [`zope.configuration.zopeconfigure`](https://github.com/zopefoundation/zope.configuration/blob/master/src/zope/configuration/zopeconfigure.py), this should not be a problem, and the simplicity of the change outweighs the possible redundancy in my opinion.