code: public T parseXml(File file) throws BuildException {
          T xml = null;
          if (file != null) {
              try {
                  if (file.exists()) {
                      Unmarshaller unmarshaller = xmlContext.createUnmarshaller();
                      xml = (T) unmarshaller.unmarshal(file);
                  } else {
                      xml = clazz.newInstance();
                  }
              } catch (JAXBException e) {
                  this.task.log("Failed to read existing XML from :\t" + file.getAbsolutePath() + ". Exception message: " + e.getMessage(), e,
                                Project.MSG_ERR);
                  throw new BuildException(e);
              } catch (IllegalAccessException e) {
                  this.task.log("Failed to create new instance of " + this.clazz + " due to an IllegalAccessException. Exception message: " + e.getMessage(), e,
                                Project.MSG_ERR);
                  throw new BuildException(e);
              } catch (InstantiationException e) {
                  this.task.log("Failed to create new instance of " + this.clazz + " due to an InstantiationException. Exception message: " + e.getMessage(), e,
                                Project.MSG_ERR);
                  throw new BuildException(e);
              }
          }
          return xml;
      }
docs: This method will parse the supplied file and return the root document for it. If the file does not exist then a new instance of the root object will be created however if it
  is <code>null</code> then <code>null</code> is returned.
  
  @param file The file to parse
  @return The parsed document or <code>null</code> if the file was <code>null</code>. If the file was not <code>null</code> did not exist then a new instance is returned
  @throws BuildException if something goes wrong