I have to write some code to handle reading and validating XML documents that use a version attribute in their root element to declare a version number, like this:
My Suggestion
Building DOMSource from parsed document
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(new File(args[0]));
domSource = new DOMSource(document);