Get XML contents before parsing.

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