code: public XMLDatastreamProcessor newVersion() throws ServerInitializationException, ModuleInitializationException {
  
          // create new datastream (version) based on existing datastream control group
          Datastream ds;
          if (m_dsType == DS_TYPE.INLINE_XML) {
              ds = new DatastreamXMLMetadata();
              ds.DSControlGrp = "X";
          } else if (m_dsType == DS_TYPE.MANAGED) {
              ds = new DatastreamManagedContent();
              ds.DSControlGrp = "M";
          } else {
              // unhandled type is a coding error
              throw new RuntimeException("XML datastreams must be of type Managed or Inline");
          }
          return new XMLDatastreamProcessor(ds);
  
      }
docs: Return a new XML Datastream processor wrapping a new datastream.  The type (M or X) of the
  new datastream will be the same as the existing one.  Use to generate new versions of existing
  datastreams and wrap them in an XML datastream processor.
  
  @throws ServerInitializationException
  @throws ModuleInitializationException