title: Modifying an XAML file
body: <p>I need to write a small console application that takes an XAML file as a parameter, and then makes a copy of it with 2 modifications:</p>
  
  <p>1) All <code>Text</code> attributes are set to the string "example" (not on every tag, only where they were actually set to something else)</p>
  
  <p>2) All tags that contain the attribute <code>Header</code>, will have a header template inside the tag instead. For example, this:</p>
  
  <pre><code>&lt;GridViewColumn Header="example"&gt;
      &lt;!-- Some other stuff... --&gt;
  &lt;/GridViewColumn&gt;
  </code></pre>
  
  <p>Should be changed to this:</p>
  
  <pre><code>&lt;GridViewColumn&gt;
      &lt;GridViewColumn.HeaderTemplate&gt;
         &lt;DataTemplate&gt;
             &lt;TextBlock Text="example"/&gt;
         &lt;/DataTemplate&gt;
  &lt;/GridViewColumn&gt;
  </code></pre>
  
  <p>I was thinking of using Regex for the logic, but I want to know if there's an easier way to do this?</p>