Fix the issue if the specified result path does not exist

@ikeough

When the result directory specified in the UI does not exist, XmlWriter will throw an exception when it attempts to construct from the directory. This submission fixes the issue by double checking whether the result directory exists, if not, it will create the directory.