This function is unnecessary. We should just be catching the exceptions thrown by our own Parse function instead of the XDocument.Load. If a file doesn't have an error it has to be parsed twice, once by XDocument and then once by our own XMLParser. XDocument is way less intense, so it may be negligible for smaller files, but I feel like it would still add some time for bigger files.