public override void WriteProcessingInstruction(string name, string text)
{
if (IsClosed)
ThrowClosed();
if (name != "xml")
throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(SR.Format(SR.XmlProcessingInstructionNotSupported), nameof(name)));
if (_writeState != WriteState.Start)
throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.XmlInvalidDeclaration)));
// The only thing the text can legitimately contain is version, encoding, and standalone.
// We only support version 1.0, we can only write whatever encoding we were supplied,
// and we don't support DTDs, so whatever values are supplied in the text argument are irrelevant.
_writer.WriteDeclaration();
}