public String validate(final String xml) {
        final Source source = new SAXSource(reader, new InputSource(IOUtils.toInputStream(xml, Charset.defaultCharset())));
        return validate(source);
    }
@Test
    public void testInValidXML() throws Exception {

        String payload = IOUtils.toString(ClassLoader.getSystemResourceAsStream("xml/article-2.xml"),
                Charset.defaultCharset());
        logger.info("Validating payload: {}", payload);
        // validate
        String result = getProcessor("sch/schematron-2.sch", null).validate(payload);
        logger.info("Schematron Report: {}", result);
        // should throw two assertions because of the missing chapters in the XML.
        assertEquals("A chapter should have a title", Utils.evaluate("//svrl:failed-assert/svrl:text", result));
        assertEquals("'chapter' element has more than one title present",
                Utils.evaluate("//svrl:successful-report/svrl:text", result).trim());

    }