Consistent way of handling files
Slightly more robust XML parser