Fixed adding property to XML properties file

When adding new property to properties in XML format, the underlying file is never updated. New element is created, but not attached to root element of properties file. 

This functionality is used for example in [wicketforge plugin](https://code.google.com/p/wicketforge/source/browse/src/wicketforge/action/ExtractPropertiesAction.java).

Method was not covered by tests, so I added also a test for it.