title: Is there a way to get a System.Configuration.Configuration instance based on arbitrary xml?
body: <p>I'm trying to unit test a custom ConfigurationSection I've written, and I'd like to load some arbitrary configuration XML into a <a href="http://msdn.microsoft.com/en-us/library/system.configuration.configuration.aspx" rel="noreferrer">System.Configuration.Configuration</a> for each test (rather than put the test configuration xml in the Tests.dll.config file.  That is, I'd like to do something like this:</p>
  
  <pre><code>Configuration testConfig = new Configuration("&lt;?xml version=\"1.0\"?&gt;&lt;configuration&gt;...&lt;/configuration&gt;");
  MyCustomConfigSection section = testConfig.GetSection("mycustomconfigsection");
  Assert.That(section != null);
  </code></pre>
  
  <p>However, it looks like <a href="http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager.aspx" rel="noreferrer">ConfigurationManager</a> will only give you Configuration instances that are associated with an EXE file or a machine config.  Is there a way to load arbitrary XML into a Configuration instance?</p>