waterml/src/main/java/ucar/nc2/ogc/waterml/NcCollectionType.java
public static CollectionType initCollection(CollectionType collection, FeatureDatasetPoint fdPoint,
            List<VariableSimpleIF> dataVars) throws IOException {
        // @gml:id
        String id = MarshallingUtil.createIdForType(CollectionType.class);
        collection.setId(id);

        // wml2:metadata
        NcDocumentMetadataPropertyType.initMetadata(collection.addNewMetadata());

        // wml2:observationMember[0..*]
        StationTimeSeriesFeatureCollection stationFeatColl = getStationFeatures(fdPoint);
        try {
            while (stationFeatColl.hasNext()) {
                StationTimeSeriesFeature stationFeat = stationFeatColl.next();

                for (VariableSimpleIF dataVar : dataVars) {
                    if (dataVar.getDataType().isNumeric()) {
                        // wml2:observationMember
                        NcOMObservationPropertyType.initObservationMember(
                                collection.addNewObservationMember(), stationFeat, dataVar);
                    }
                }
            }
        } finally {
            stationFeatColl.finish();
        }

        return collection;
    }
public static CollectionType initCollection(CollectionType collection, FeatureDatasetPoint fdPoint,
            List<VariableSimpleIF> dataVars) throws IOException {
        // @gml:id
        String id = MarshallingUtil.createIdForType(CollectionType.class);
        collection.setId(id);

        // wml2:metadata
        NcDocumentMetadataPropertyType.initMetadata(collection.addNewMetadata());

        // wml2:observationMember[0..*]
        StationTimeSeriesFeatureCollection stationFeatColl = getStationFeatures(fdPoint);
        try {
            while (stationFeatColl.hasNext()) {
                StationTimeSeriesFeature stationFeat = stationFeatColl.next();

                for (VariableSimpleIF dataVar : dataVars) {
                    if (dataVar.getDataType().isNumeric()) {
                        // wml2:observationMember
                        NcOMObservationPropertyType.initObservationMember(
                                collection.addNewObservationMember(), stationFeat, dataVar);
                    }
                }
            }
        } finally {
            stationFeatColl.finish();
        }

        return collection;
    }
wml2:Collection