private MetadataType createMetaData(GpxRoute route, GpxType gpxType) { ObjectFactory objectFactory = new ObjectFactory(); MetadataType metadataType = gpxType.getMetadata(); if (metadataType == null) metadataType = objectFactory.createMetadataType(); if (isWriteName()) { metadataType.setName(asRouteName(route.getName())); metadataType.setDesc(asDescription(route.getDescription())); } return metadataType; }