function writeFilter(filter, version) {
  version = version || '1.1.0';
  const child = createElementNS(getFilterNS(version), 'Filter');
  const context = {
    node: child,
  };
  Object.assign(context, {
    'version': version,
    'filter': filter,
  });
  writeFilterCondition(child, filter, [context]);
  return child;
}
Encode filter as WFS `Filter` and return the Node.

@param {import("./filter/Filter.js").default} filter Filter.
@param {string} version WFS version. If not provided defaults to '1.1.0'
@return {Node} Result.
@api