cleaned up the code that generates the window where the aperio xml document is loaded