cdm/src/main/java/ucar/nc2/dt/grid/GridDatasetInfo.java
public Document makeDatasetDescription() {
		Element rootElem = new Element("gridDataset");
		Document doc = new Document(rootElem);
		rootElem.setAttribute("location", gds.getLocation());
		if (null != path)
			rootElem.setAttribute("path", path);

		/* dimensions
    List dims = getDimensions(gds);
    for (int j = 0; j < dims.size(); j++) {
      Dimension dim = (Dimension) dims.get(j);
      rootElem.addContent(ucar.nc2.ncml.NcMLWriter.writeDimension(dim, null));
    } */

		// coordinate axes
		for (CoordinateAxis axis : getCoordAxes(gds)) {
			rootElem.addContent(writeAxis(axis));
		}

		/* grids
    List grids = gds.getGrids();
    Collections.sort(grids, new GridComparator());
    for (int i = 0; i < grids.size(); i++) {
      GeoGrid grid = (GeoGrid) grids.get(i);
      rootElem.addContent(writeGrid(grid));
    } */

		/* coordinate systems
    List gridSets = gds.getGridsets();
    for (int i = 0; i < gridSets.size(); i++) {
      GridDataset.Gridset gridset = (GridDataset.Gridset) gridSets.get(i);
      rootElem.addContent(writeCoordSys(gridset.getGeoCoordSystem()));
    } */

		// gridSets
		List<GridDataset.Gridset> gridSets = gds.getGridsets();
		Collections.sort(gridSets, new GridSetComparator());
		for (GridDataset.Gridset gridset : gridSets) {
			rootElem.addContent(writeGridSet(gridset));
		}

		// coordinate transforms
		for (CoordinateTransform ct : getCoordTransforms(gds)) {
			rootElem.addContent(writeCoordTransform(ct));
		}

		/* global attributes
    Iterator atts = gds.getGlobalAttributes().iterator();
    while (atts.hasNext()) {
      ucar.nc2.Attribute att = (ucar.nc2.Attribute) atts.next();
      rootElem.addContent(ucar.nc2.ncml.NcMLWriter.writeAttribute(att, "attribute", null));
    } */

		// add lat/lon bounding box
		LatLonRect bb = gds.getBoundingBox();
		if (bb != null)
			rootElem.addContent(writeBoundingBox(bb));

		// add date range
		CalendarDate start = gds.getCalendarDateStart();
		CalendarDate end = gds.getCalendarDateEnd();
		if ((start != null) && (end != null)) {
			Element dateRange = new Element("TimeSpan");
			dateRange.addContent(new Element("begin").addContent(start.toString()));
			dateRange.addContent(new Element("end").addContent(end.toString()));
			rootElem.addContent(dateRange);
		}

		// add accept list
		addAcceptList(rootElem);

		//    elem.addContent(new Element("accept").addContent("xml"));
		//    elem.addContent(new Element("accept").addContent("csv"));
		//    elem.addContent(new Element("accept").addContent("netcdf"));    
		return doc;
	}
public Document makeDatasetDescription() {
		Element rootElem = new Element("gridDataset");
		Document doc = new Document(rootElem);
		rootElem.setAttribute("location", gds.getLocation());
		if (null != path)
			rootElem.setAttribute("path", path);

		/* dimensions
    List dims = getDimensions(gds);
    for (int j = 0; j < dims.size(); j++) {
      Dimension dim = (Dimension) dims.get(j);
      rootElem.addContent(ucar.nc2.ncml.NcMLWriter.writeDimension(dim, null));
    } */

		// coordinate axes
		for (CoordinateAxis axis : getCoordAxes(gds)) {
			rootElem.addContent(writeAxis(axis));
		}

		/* grids
    List grids = gds.getGrids();
    Collections.sort(grids, new GridComparator());
    for (int i = 0; i < grids.size(); i++) {
      GeoGrid grid = (GeoGrid) grids.get(i);
      rootElem.addContent(writeGrid(grid));
    } */

		/* coordinate systems
    List gridSets = gds.getGridsets();
    for (int i = 0; i < gridSets.size(); i++) {
      GridDataset.Gridset gridset = (GridDataset.Gridset) gridSets.get(i);
      rootElem.addContent(writeCoordSys(gridset.getGeoCoordSystem()));
    } */

		// gridSets
		List<GridDataset.Gridset> gridSets = gds.getGridsets();
		Collections.sort(gridSets, new GridSetComparator());
		for (GridDataset.Gridset gridset : gridSets) {
			rootElem.addContent(writeGridSet(gridset));
		}

		// coordinate transforms
		for (CoordinateTransform ct : getCoordTransforms(gds)) {
			rootElem.addContent(writeCoordTransform(ct));
		}

		/* global attributes
    Iterator atts = gds.getGlobalAttributes().iterator();
    while (atts.hasNext()) {
      ucar.nc2.Attribute att = (ucar.nc2.Attribute) atts.next();
      rootElem.addContent(ucar.nc2.ncml.NcMLWriter.writeAttribute(att, "attribute", null));
    } */

		// add lat/lon bounding box
		LatLonRect bb = gds.getBoundingBox();
		if (bb != null)
			rootElem.addContent(writeBoundingBox(bb));

		// add date range
		CalendarDate start = gds.getCalendarDateStart();
		CalendarDate end = gds.getCalendarDateEnd();
		if ((start != null) && (end != null)) {
			Element dateRange = new Element("TimeSpan");
			dateRange.addContent(new Element("begin").addContent(start.toString()));
			dateRange.addContent(new Element("end").addContent(end.toString()));
			rootElem.addContent(dateRange);
		}

		// add accept list
		addAcceptList(rootElem);

		//    elem.addContent(new Element("accept").addContent("xml"));
		//    elem.addContent(new Element("accept").addContent("csv"));
		//    elem.addContent(new Element("accept").addContent("netcdf"));    
		return doc;
	}
public Document makeDatasetDescription ( ) { Element rootElem = new Element ( "gridDataset" ) ; Document doc = new Document ( rootElem ) ; rootElem . setAttribute ( "location" , gds . getLocation ( ) ) ; if ( null != path ) rootElem . setAttribute ( "path" , path ) ; /* dimensions
    List dims = getDimensions(gds);
    for (int j = 0; j < dims.size(); j++) {
      Dimension dim = (Dimension) dims.get(j);
      rootElem.addContent(ucar.nc2.ncml.NcMLWriter.writeDimension(dim, null));
    } */ // coordinate axes
 for ( CoordinateAxis axis : getCoordAxes ( gds ) ) { rootElem . addContent ( writeAxis ( axis ) ) ; } /* grids
    List grids = gds.getGrids();
    Collections.sort(grids, new GridComparator());
    for (int i = 0; i < grids.size(); i++) {
      GeoGrid grid = (GeoGrid) grids.get(i);
      rootElem.addContent(writeGrid(grid));
    } */ /* coordinate systems
    List gridSets = gds.getGridsets();
    for (int i = 0; i < gridSets.size(); i++) {
      GridDataset.Gridset gridset = (GridDataset.Gridset) gridSets.get(i);
      rootElem.addContent(writeCoordSys(gridset.getGeoCoordSystem()));
    } */ // gridSets
 List < GridDataset . Gridset > gridSets = gds . getGridsets ( ) ; Collections . sort ( gridSets , new GridSetComparator ( ) ) ; for ( GridDataset . Gridset gridset : gridSets ) { rootElem . addContent ( writeGridSet ( gridset ) ) ; } // coordinate transforms
 for ( CoordinateTransform ct : getCoordTransforms ( gds ) ) { rootElem . addContent ( writeCoordTransform ( ct ) ) ; } /* global attributes
    Iterator atts = gds.getGlobalAttributes().iterator();
    while (atts.hasNext()) {
      ucar.nc2.Attribute att = (ucar.nc2.Attribute) atts.next();
      rootElem.addContent(ucar.nc2.ncml.NcMLWriter.writeAttribute(att, "attribute", null));
    } */ // add lat/lon bounding box
 LatLonRect bb = gds . getBoundingBox ( ) ; if ( bb != null ) rootElem . addContent ( writeBoundingBox ( bb ) ) ; // add date range
 CalendarDate start = gds . getCalendarDateStart ( ) ; CalendarDate end = gds . getCalendarDateEnd ( ) ; if ( ( start != null ) && ( end != null ) ) { Element dateRange = new Element ( "TimeSpan" ) ; dateRange . addContent ( new Element ( "begin" ) . addContent ( start . toString ( ) ) ) ; dateRange . addContent ( new Element ( "end" ) . addContent ( end . toString ( ) ) ) ; rootElem . addContent ( dateRange ) ; } // add accept list
 addAcceptList ( rootElem ) ; //    elem.addContent(new Element("accept").addContent("xml"));
 //    elem.addContent(new Element("accept").addContent("csv"));
 //    elem.addContent(new Element("accept").addContent("netcdf"));    
 return doc ; }
Create the "Dataset Description" XML document from this GridDataset

@return a JDOM Document
Create the Dataset Description XML document from this GridDataset