cdm/src/main/java/thredds/client/catalog/tools/CatalogXmlWriter.java
protected void writeInheritedMetadata(Element elem, Dataset ds) {
    Element mdataElem = new Element("metadata", Catalog.defNS);
    mdataElem.setAttribute("inherited", "true");
    ThreddsMetadata tmi = (ThreddsMetadata) ds.getLocalField(Dataset.ThreddsMetadataInheritable);
    if (tmi == null) return;
    writeThreddsMetadata(mdataElem, tmi);
    if (mdataElem.getChildren().size() > 0)
      elem.addContent(mdataElem);
  }
protected void writeInheritedMetadata(Element elem, Dataset ds) {
    Element mdataElem = new Element("metadata", Catalog.defNS);
    mdataElem.setAttribute("inherited", "true");
    ThreddsMetadata tmi = (ThreddsMetadata) ds.getLocalField(Dataset.ThreddsMetadataInheritable);
    if (tmi == null) return;
    writeThreddsMetadata(mdataElem, tmi);
    if (mdataElem.getChildren().size() > 0)
      elem.addContent(mdataElem);
  }
/* protected void writeCat6InheritedMetadata( Element elem, ThreddsMetadata tmi) {
if ((tmi.getDataType() == null) && (tmi.getServiceName() == null) &&
(tmi.getAuthority() == null) && ( tmi.getProperties().size() == 0))
return;

Element mdataElem = new Element("metadata", Catalog.defNS);
mdataElem.setAttribute("inherited", "true");
writeThreddsMetadata( mdataElem, tmi);
elem.addContent( mdataElem);
}