Saxon API for .NET |

# Serializer.SetOutputWriter Method

Specify the destination of the serialized output, in the form of a `TextWriter`

public void SetOutputWriter(
TextWriter textWriter
);

#### Parameters

textWriter
  The stream to which the output will be written. This must be a stream that allows writing.

#### Remarks

Note that when writing to a `TextWriter`, character encoding is the responsibility of the `TextWriter`, not the `Serializer`. This means that the encoding requested in the output properties is ignored; it also means that characters that cannot be represented in the target encoding will use whatever fallback representation the `TextWriter` defines, rather than being represented as XML character references.

#### See Also

Serializer Class | Saxon.Api Namespace