public override void WriteProcessingInstruction (string name, string text)
{
if (name == null)
throw ArgumentError ("name");
if (text == null)
throw ArgumentError ("text");
WriteIndent ();
if (!XmlChar.IsName (name))
throw ArgumentError ("A processing instruction name must be a valid XML name.");
if (StringUtil.IndexOf (text, "?>") > 0)
throw ArgumentError ("Processing instruction cannot contain \"?>\" as its value.");
ShiftStateTopLevel ("ProcessingInstruction", false, name == "xml", false);
writer.Write ("<?");
writer.Write (name);
writer.Write (' ');
writer.Write (text);
writer.Write ("?>");
if (state == WriteState.Start)
state = WriteState.Prolog;
}