code: protected XWikiDocument getDocFromXML(File file) throws MojoExecutionException
      {
          XWikiDocument doc;
  
          try {
              doc = new XWikiDocument();
              doc.fromXML(file);
          } catch (Exception e) {
              throw new MojoExecutionException(String.format("Failed to parse [%s].", file.getAbsolutePath()), e);
          }
  
          return doc;
      }
docs: Load a XWiki document from its XML representation.
  
  @param file the file to parse.
  @return the loaded document object or null if the document cannot be parsed