Get XML contents before parsing.

This solves the problems with XML failing to load in paths containing spaces.

Fixes #157.
Merge pull request #177 from mikaeljorhult/GH157

Get XML contents before parsing.