private ModelMarshallingContext sanitizeContext(final ModelMarshallingContext context) {
if (writeSanitizer == null) {
return context;
}
final ModelNode model = writeSanitizer.sanitize(context.getModelNode());
return new ModelMarshallingContext() {
@Override
public XMLElementWriter<SubsystemMarshallingContext> getSubsystemWriter(String subsystemName) {
return context.getSubsystemWriter(subsystemName);
}