Fixes #5065: create a generic method to add line in xml section

This should include the ```no_change``` class