// call this method first for repository validity before do anything else...
  public static boolean isValid(String baseURL) {
    boolean res = false;
    Identify ident = null;
    // validate baseURL
    try {
      ident = new Identify(baseURL);
      res = true;
    } catch (IOException e) {
      // e.printStackTrace();
      res = false;
    } catch (ParserConfigurationException e) {
      // e.printStackTrace();
      res = false;
    } catch (SAXException e) {
      // e.printStackTrace();
      res = false;
    } catch (TransformerException e) {
      // e.printStackTrace();
      res = false;
    }

    // validate response (version plus xml response structure)
    if (ident != null) {

      try {
        NodeList errors = ident.getErrors();
        if ((errors != null) && (errors.getLength() > 0)) {
          res = false;
        } else {
          ident.getProtocolVersion();
          res = true;
        }
      } catch (TransformerException e) {
        // e.printStackTrace();
        res = false;
      } catch (NoSuchFieldException e) {
        // e.printStackTrace();
        res = false;
      }
    }

    ident = null; // clean up the mess ;)
    return res;
  }