code: public void setXMLContent(byte[] xmlContent) {
          if (m_dsType == DS_TYPE.INLINE_XML) {
              ((DatastreamXMLMetadata)m_ds).xmlContent = xmlContent;
              ((DatastreamXMLMetadata)m_ds).DSSize = (xmlContent != null) ? xmlContent.length : -1;
          } else if (m_dsType == DS_TYPE.MANAGED) {
              ByteArrayInputStream bais = new ByteArrayInputStream(xmlContent);
              MIMETypedStream s = new MIMETypedStream("text/xml", bais, null,xmlContent.length);
              try {
                  ((DatastreamManagedContent)m_ds).putContentStream(s);
              } catch (StreamIOException e) {
                  throw new RuntimeException("Unable to update managed datastream contents", e);
              }
          } else
              // coding error if trying to use other datastream type
              throw new RuntimeException("XML datastreams must be of type Managed or Inline");
      }
docs: Update the XML content of the datastream wrapped by this class
  @param xmlContent