title: Get XAML source of WPF Window
body: <p>I would like to get the XAML source of a WPF Window (MainWindow). Clicking on a button on that window would return the XAML of the window and I would save it in another file.</p>
  
  <p>Is this possible and how can it be achieved?</p>