public static boolean ValidateSource(String xmlString, String xsdFile, StringBuilder message){
        Source schemaFile = new StreamSource(new File(xsdFile));
        SchemaFactory schemaFactory = SchemaFactory
                .newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
        Schema schema = null;
        try {
            schema = schemaFactory.newSchema(schemaFile);
        } catch (SAXException e) {
            e.printStackTrace();
        }
        javax.xml.validation.Validator validator = schema.newValidator();
        try {
            Source src = new StreamSource(new java.io.StringReader(xmlString));
            validator.validate(src);
        } catch (SAXException e) {
            message.append(e.getLocalizedMessage());
            return false;
        } catch (IOException e) {
            e.printStackTrace();
        }
        message.append("xml is valid");
        return true;
    }