/// <summary>
 /// Creates a text reader that will replace invalid XML chars with whitespace
 /// so that the XML parser will not abort while reading the XML.
 /// </summary>
 /// <param name="reader"></param>
 public static TextReader CreateSafeTextReader(TextReader reader)
 {
     if (!(reader is SafeXmlTextReader))
     {
         reader = new SafeXmlTextReader(reader);
     }
     return(reader);
 }
 /// <summary>
 /// Creates a text reader that will replace invalid XML chars with whitespace
 /// so that the XML parser will not abort while reading the XML.
 /// </summary>
 /// <param name="reader"></param>
 public static TextReader CreateSafeTextReader(TextReader reader)
 {
     if (!(reader is SafeXmlTextReader))
     {
         reader = new SafeXmlTextReader(reader);
     }
     return reader;
 }