|According to the documentation the
ReadElementString method positions the reader on the node following the EndElement node; in you case on the next "test" StartElement node. Afterwards you call
Read inside the while statement which advances the reader to the next node and thereby your code only recognizes every second "test" element. I'm not that used to the XmlTextReader, so you have to experiment a bit which method gives you the desired result.
By the way calling
ToString on the result of
ReadElementString is redundant as it already returns a string.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cookwww.troschuetz.de