The writeFeatures method should always return a string

This PR fixes  #2102

All writeFeatures, writeFeature and writeGeometry methods now return a string. The respective methods such as writeFeaturesObject (JSON) and writeFeaturesNode (XML) have been marked api but not stable as yet.
Shouldn't this be simplified to use `writeFeatures` instead of creating a node and then serializing with `XMLSerializer` below?