XML tag are designed not for stripping them. They allow you to parse XML without any problems with detail of formatting, according strict syntax. By "stripping", you loose essential information on data structure. Please don't tell me you don't need structure. It does not really matter. If you need to read XML, you parse it, nothing else.
With .NET FCL, you are given at least three different approach to parsing. Please see my short review of them:
- Use
System.Xml.XmlDocument
class. It implements DOM interface; this way is the easiest and good enough if the size if the document is not too big.
See http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx[^]. - Use the class
System.Xml.XmlTextReader
; this is the fastest way of reading, especially is you need to skip some data.
See http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.aspx[^]. - Use the class
System.Xml.Linq.XDocument
; this is the most adequate way similar to that of XmlDocument
, supporting LINQ to XML Programming.
See http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx[^], http://msdn.microsoft.com/en-us/library/bb387063.aspx[^].
—SA