Completely overhauled the way the code handles XML files (now using LINQ and XDocument).