/// <summary>
 /// Writes text from a string.
 /// </summary>
 /// <param name="text">The string to write.</param>
 /// <seealso cref="XmlWriter.WriteString(string)"/>
 public override void WriteString(string text)
 {
     if (WriteState == WriteState.Attribute)
     {
         Impl.WriteRaw(ATTR_ESCAPE.Replace(text, Escape));
     }
     else
     {
         Impl.WriteRaw(CONTENT_ESCAPE.Replace(text, Escape));
     }
 }
 /// <summary>
 /// Writes text from a string async.
 /// </summary>
 /// <param name="text">The string to write.</param>
 /// <returns>The async task.</returns>
 /// <seealso cref="XmlWriter.WriteStringAsync(string)"/>
 public override Task WriteStringAsync(string text)
 {
     if (WriteState == WriteState.Attribute)
     {
         return(Impl.WriteRawAsync(ATTR_ESCAPE.Replace(text, Escape)));
     }
     else
     {
         return(Impl.WriteRawAsync(CONTENT_ESCAPE.Replace(text, Escape)));
     }
 }