private void writeTravelBugs(@NonNull final Geocache cache) throws IOException {
        final List<Trackable> inventory = cache.getInventory();
        if (CollectionUtils.isEmpty(inventory)) {
            return;
        }
        gpx.startTag(NS_GROUNDSPEAK, "travelbugs");

        for (final Trackable trackable : inventory) {
            gpx.startTag(NS_GROUNDSPEAK, "travelbug");

            // in most cases the geocode will be empty (only the guid is known). those travel bugs cannot be imported again!
            gpx.attribute("", "ref", trackable.getGeocode());
            XmlUtils.simpleText(gpx, NS_GROUNDSPEAK, "name", trackable.getName());

            gpx.endTag(NS_GROUNDSPEAK, "travelbug");
        }

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