Use writeFeatures instead of writeFeaturesNode in GPX and KML example