// Apply the filter
WordprocessingMLPackage.FilterSettings filterSettings = new WordprocessingMLPackage.FilterSettings();
filterSettings.setRemoveProofErrors(true);
filterSettings.setRemoveContentControls(true);
filterSettings.setRemoveRsids(true);
wmlPackage.filter(filterSettings);
// Note the filter is deprecated, since its questionable whether this
// is important enough to live in WordprocessingMLPackage,
// and in any case probably should be replaced with a TraversalUtil
// approach (which wouldn't involve marshal/unmarshall, and
// so should be more efficient).