public XmlBlob generateCumulativeXmlBlob(ExtensionProfile extProfile) throws IOException {
  XmlBlob cumulative=new XmlBlob();
  Collection<XmlNamespace> namespaces=cumulative.getNamespaces();
  StringWriter w=new StringWriter();
  XmlWriter xw=new XmlWriter(w);
  if (xmlBlob != null) {
    cumulative.setLang(xmlBlob.getLang());
    cumulative.setBase(xmlBlob.getBase());
    namespaces.addAll(xmlBlob.getNamespaces());
    w.write(xmlBlob.getBlob());
  }
  if (manifest != null) {
    for (    XmlNamespace ns : manifest.getNamespaceDecls()) {
      XmlNamespace newNs=new XmlNamespace(ns.getAlias(),ns.getUri());
      if (!namespaces.contains(newNs)) {
        namespaces.add(newNs);
      }
    }
  }
  for (  Extension ext : nonRepeatingExtensionMap.values()) {
    ext.generate(xw,extProfile);
  }
  for (  List<Extension> extList : repeatingExtensionMap.values()) {
    xw.startRepeatingElement();
    for (    Extension ext : extList) {
      ext.generate(xw,extProfile);
    }
    xw.endRepeatingElement();
  }
  cumulative.setBlob(w.toString());
  return cumulative;
}

public XmlBlob generateCumulativeXmlBlob ( ExtensionProfile extProfile ) throws IOException { XmlBlob cumulative = new XmlBlob ( ) ; Collection < XmlNamespace > namespaces = cumulative . getNamespaces ( ) ; StringWriter w = new StringWriter ( ) ; XmlWriter xw = new XmlWriter ( w ) ; if ( xmlBlob != null ) { cumulative . setLang ( xmlBlob . getLang ( ) ) ; cumulative . setBase ( xmlBlob . getBase ( ) ) ; namespaces . addAll ( xmlBlob . getNamespaces ( ) ) ; w . write ( xmlBlob . getBlob ( ) ) ; } if ( manifest != null ) { for ( XmlNamespace ns : manifest . getNamespaceDecls ( ) ) { XmlNamespace newNs = new XmlNamespace ( ns . getAlias ( ) , ns . getUri ( ) ) ; if ( ! namespaces . contains ( newNs ) ) { namespaces . add ( newNs ) ; } } } for ( Extension ext : nonRepeatingExtensionMap . values ( ) ) { ext . generate ( xw , extProfile ) ; } for ( List < Extension > extList : repeatingExtensionMap . values ( ) ) { xw . startRepeatingElement ( ) ; for ( Extension ext : extList ) { ext . generate ( xw , extProfile ) ; } xw . endRepeatingElement ( ) ; } cumulative . setBlob ( w . toString ( ) ) ; return cumulative ; }
generates an xml blob containing all recognized and unrecognized extensions . this can be used by applications that persist data in a store that might be accessed by other applications - - ones that don ' t necessarily recognize the same set of extensions .
