title: Retrieving and processing a server side value from XML at runtime
body: <p>I am trying to implement a solution to updating what a user control displays without republishing the user control itself. The UC gets xml from an external file as its content rather than storing the content in the control, so the xml is what is republished instead of the UC.</p>
  
  <p>The issue is that I also have a need for the content to contain inline variables such as &lt;% =myvariable %>. Is there a way to retrieve the xml and then run that also at runtime instead of treating it as text?</p>
  
  <p>The following is just a rudimentary example with only the basics related to this issue specifically, not the full extent of the code on the page, but hopefully it is enough to illuminate what I am asking. Instead of just "Response.Write(xmlcontent);" is there some way I can get the value of the retrieve xml to run as if it were "native" to the page at runtime and process that inline variable?</p>
  
  <p>User Control:</p>
  
  <pre><code>&lt;script runat="server"&gt;
  string xmlcontent = "";
  protected override void OnLoad(EventArgs e)
  {
      try
      {
          XmlDocument doc = new XmlDocument();
          doc.Load(Server.MapPath("/usercontrols/xml/test.xml"));
          xmlcontent = doc.SelectSingleNode("content").InnerText;
      }
  
      catch
      {
  
      }
  }
  
  &lt;/script&gt;
  
  &lt;%if (!string.IsNullOrEmpty(xmlcontent))
  
   {
       Response.Write(xmlcontent);
   } %&gt;
  </code></pre>
  
  <p>XML:</p>
  
  <pre><code>&lt;content&gt;
  &lt;![CDATA[&lt;div&gt;This is the content. The next word is a C# variable &lt;% =variabletest %&gt;.&lt;/div&gt;]]&gt;
  &lt;/content&gt;
  </code></pre>