title: Nested elements and scripts
body: <p>I'am currently trying to create and application (In c#) that parse a XML file and from that change the Text depending on the elements and tags inside the text.</p>
  
  <p>Example:</p>
  
  <pre><code> &lt;conversation&gt;
     &lt;message from=Bob&gt;
         &lt;typewriter dif=0.5&gt;
             &lt;Text&gt;               
                 Bob: Hello &lt;replace&gt;Country&lt;with&gt;World&lt;/with&gt;&lt;/replace&gt;`
             &lt;/Text&gt;
        &lt;/typewriter&gt;
     &lt;message&gt;
  &lt;/conversation&gt;
  </code></pre>
  
  <p>The output would look like this:</p>
  
  <p>It starts writing "Bob: Hello Country" like a old typewriter (letter for letter) and when "Country" is written it will remove that word and start to write World instead. So the final output would be "Bob: Hello World"</p>
  
  <p>So here are my questions:
  After parsing the XML file, what is a good approach for storing the data so the program knows what elements contains what elements? (eg. Message contains typewriter)</p>
  
  <p>To get the program to recognize script tags inside of the Text element. How do i do that? and how get it to work like the example?</p>
  
  <p>I'am not asking for completed code here, just some pointers in the right direction. I'am still a beginner at programming so i want to learn.</p>
  
  <p>I didn't know what to search for so if something like this is already posted then i'am sorry.</p>