A validação XML não libera o arquivo xml

Estou tentando validar um arquivo XML contra um arquivo XSD em JAVA. Meu problema não é a validação em si, pois está funcionando bem. Meu problema é que o XMLfile não é liberado após a validação. Se estou tentando acessar o arquivo posteriormente, recebo o erro "O arquivo é usado por outro recurso".

Esse erro ocorre apenas quando a validação falha (uma exceção é lançada do validator.validate (xmlSource);) Se o arquivo for validado sem problemas, ele será liberado e poderá ser acessado por outras pessoas.

Algum idears?

public void validateXMLAgainstXSD(String xmlPath, String xsdPath) throws ParserException, IOException
  {
    Source xmlSource = null;
    File schemaFile = null;
    SchemaFactory schemaFactory = null;
    Schema schema = null;
    Validator validator = null;
    try 
    {
      schemaFile = new File(xsdPath);
      xmlSource = new StreamSource(new File(xmlPath));
      schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
      schema = schemaFactory.newSchema(schemaFile);
      validator = schema.newValidator();
      validator.validate(xmlSource);
    }
    catch (SAXException e)
    {
      //_log.error("ParsingDataFile: XML file could not be validated against XSD file: XML File=<", xmlFile.getAbsolutePath(), "> XSD file=<", xsdFile.getAbsolutePath(), ">. Exception=<", e, ">");
      xmlSource = null;
      schemaFile = null;
      schemaFactory = null;
      schema = null;
      validator.reset();
      validator = null;      
      //throw new ParserException(-1, ParserException.ERROR_CODE_XML_NOT_VALID, e);
    }
  }

questionAnswers(1)

yourAnswerToTheQuestion