better error handling for XML document