class XmlCheck {

  public static boolean isXmlWellFormed(InputStream is ) throws HopException {
    boolean retval = false;
    try {
      SAXParserFactory factory = XmlParserFactoryProducer.createSecureSAXParserFactory();
      XMLTreeHandler handler = new XMLTreeHandler();

      // Parse the input.
      SAXParser saxParser = factory.newSAXParser();
      saxParser.parse( is, handler );
      retval = true;
    } catch ( Exception e ) {
      throw new HopException( e );
    }
    return retval;
  }

}