theparms.put("mimeType", ((DocumentImpl)document).getMimeType());
theparms.put("preserveOriginalContent", document.getPreserveOriginalContent());
theparms.put("stringContent", newText);
FeatureMap thefeats = Factory.newFeatureMap();
FeatureMap docfeats = document.getFeatures();
for(Object k : docfeats.keySet()) {
thefeats.put(k, docfeats.get(k));
}
String theName = document.getName();
// create a copy of the current document