<p>Does anyone know an easy way to import a raw, XML RSS feed into C#?  Am looking for an easy way to get the XML as a string so I can parse it with a Regex.</p>

<p>Thanks,
-Greg</p>

[{'answer_id': 67946, 'author': 'MagicKat', 'author_id': 8505, 'author_profile': 'https://Stackoverflow.com/users/8505', 'pm_score': 0, 'selected': False, 'text': "<p>XmlDocument (located in System.Xml, you will need to add a reference to the dll if it isn't added for you) is what you would use for getting the xml into C#.  At that point, just call the InnerXml property which gives the inner Xml in string format then parse with the Regex.</p>\n"}, {'answer_id': 67947, 'author': 'GEOCHET', 'author_id': 5640, 'author_profile': 'https://Stackoverflow.com/users/5640', 'pm_score': 0, 'selected': False, 'text': '<p>You might want to have a look at this: <a href="http://www.codeproject.com/KB/cs/rssframework.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/cs/rssframework.aspx</a></p>\n'}, {'answer_id': 67952, 'author': 'Jonas Follesø', 'author_id': 1199387, 'author_profile': 'https://Stackoverflow.com/users/1199387', 'pm_score': 4, 'selected': False, 'text': '<p>If you\'re on .NET 3.5 you now got built-in support for syndication feeds (RSS and ATOM). Check out this <a href="http://msdn.microsoft.com/en-us/magazine/cc135976.aspx" rel="noreferrer">MSDN Magazine Article for a good introduction</a>.</p>\n\n<p>If you really want to parse the string using regex (and parsing XML is not what regex was intended for), the easiest way to get the content is to use the WebClient class.It got a download string which is straight forward to use. Just give it the URL of your feed. Check this <a href="http://www.daveamenta.com/2008-05/c-webclient-usage/" rel="noreferrer">link for an example of how to use it</a>.</p>\n'}, {'answer_id': 67995, 'author': 'Alex Lyman', 'author_id': 5897, 'author_profile': 'https://Stackoverflow.com/users/5897', 'pm_score': 0, 'selected': False, 'text': "<p>The best way to grab an RSS feed as the requested string would be to use the System.Net.HttpWebRequest class.  Once you've set up the HttpWebRequest's parameters (URL, etc.), call the HttpWebRequest.GetResponse() method.  From there, you can get a Stream with WebResponse.GetResponseStream().  Then, you can wrap that stream in a System.IO.StreamReader, and call the StreamReader.ReadToEnd().  Voila.</p>\n"}, {'answer_id': 68008, 'author': 'Darrel Miller', 'author_id': 6819, 'author_profile': 'https://Stackoverflow.com/users/6819', 'pm_score': 4, 'selected': False, 'text': '<p>This should be enough to get you going...</p>\n\n<pre><code>using System.Net \n\nWebClient wc = new WebClient();\n\nStream st = wc.OpenRead(“http://example.com/feed.rss”);\n\nusing (StreamReader sr = new StreamReader(st)) {\n   string rss = sr.ReadToEnd();\n}\n</code></pre>\n'}, {'answer_id': 68038, 'author': 'Alan Le', 'author_id': 1133, 'author_profile': 'https://Stackoverflow.com/users/1133', 'pm_score': 2, 'selected': False, 'text': '<p>I would load the feed into an XmlDocument and use XPATH instead of regex, like so:</p>\n\n<pre><code>XmlDocument doc = new XmlDocument();\n\nHttpWebRequest request = WebRequest.Create(feedUrl) as HttpWebRequest;\n\nusing (HttpWebResponse response = request.GetResponse() as HttpWebResponse)\n{\n    StreamReader reader = new StreamReader(response.GetResponseStream());\n    doc.Load(reader);\n\n    &lt;parse with XPATH&gt;\n}\n</code></pre>\n'}, {'answer_id': 80745, 'author': 'Paul van Brenk', 'author_id': 1837197, 'author_profile': 'https://Stackoverflow.com/users/1837197', 'pm_score': 2, 'selected': False, 'text': '<p>What are you trying to accomplish?</p>\n<p>I found the <a href="https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.syndication.syndicationfeed" rel="nofollow noreferrer">System.ServiceModel.Syndication</a> classes very helpful when working with feeds.</p>\n'}, {'answer_id': 139584, 'author': 'David Robbins', 'author_id': 19799, 'author_profile': 'https://Stackoverflow.com/users/19799', 'pm_score': 0, 'selected': False, 'text': "<p>The RSS is just xml and can be streamed to disk easily.  Go with Darrel's example - it's all you'll need.</p>\n"}]
['https://Stackoverflow.com/questions/67937', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8855/']