code: private Document readDocument(InputStream in, URI file) throws TransformerConfigurationException, SAXException, IOException {
          final Document document = documentBuilder.newDocument();
          if (file != null) {
              document.setDocumentURI(file.toString());
          }
  
          final TransformerHandler domSerializer = saxTransformerFactory.newTransformerHandler();
          domSerializer.setResult(new DOMResult(document));
          final InputSource inputSource = new InputSource(in);
          if (file != null) {
              inputSource.setSystemId(file.toString());
          }
          validator.validate(new SAXSource(inputSource), new SAXResult(domSerializer));
  
          return document;
      }
docs: Read and validate project file.
  
  @param in   input project file
  @param file
  @return project file document