private void writeCacheWaypoint(@NonNull final Waypoint wp) throws IOException {
        gpx.startTag(NS_GPX, "wpt");

        final Geopoint coords = wp.getCoords();
        if (coords != null) {
            gpx.attribute("", "lat", Double.toString(coords.getLatitude()));
            gpx.attribute("", "lon", Double.toString(coords.getLongitude()));
        } else {
            // coords are required information
            // "xsi:nil" is not supported by schema, hence use 0/0 as OKAPI does.
            gpx.attribute("", "lat", Double.toString(0.0));
            gpx.attribute("", "lon", Double.toString(0.0));
        }

        final String waypointTypeGpx = wp.getWaypointType().gpx;
        // combine note and user note with SEPARATOR "\n--\n"
        final WaypointUserNoteCombiner wpCombiner = new WaypointUserNoteCombiner(wp);
        final String waypointNote = wpCombiner.getCombinedNoteAndUserNote();
        XmlUtils.multipleTexts(gpx, NS_GPX, "name", wp.getGpxId(), "cmt", waypointNote, "desc", wp.getName(), "sym", waypointTypeGpx, "type", "Waypoint|" + waypointTypeGpx);

        // add parent reference the GSAK-way
        writeGsakExtensions(wp);
        // add specific cgeo-attributes
        writeCGeoAttributes(wp);

        gpx.endTag(NS_GPX, "wpt");
    }
Writes one waypoint entry for cache waypoint.
main/src/main/java/cgeo/geocaching/export/GpxSerializer.java