The fragment of code you show is one big abuse of elementary technology. Instead of directly writing all those XML angular brackets, use the class
System.Xml.XmlTextReader
:
http://msdn.microsoft.com/en-us/library/system.xml.xmltextreader%28v=vs.110%29.aspx[
^].
And you reader does read the '$' character, because it does not have any special meaning in XML; you just fail to see that. You did not show any code which reads anything except
reader.Read()
; hence, if you look through the results of the read using the debugger, you will see that all elements are read properly.
—SA