@Test
    public void testXmlAndHtmlDetection() throws Exception {
        assertTypeByData("application/xml",
                "<?xml version=\"1.0\" encoding=\"UTF-8\"?><records><record/></records>"
                        .getBytes(UTF_8));
        assertTypeByData("application/xml",
                "\uFEFF<?xml version=\"1.0\" encoding=\"UTF-16\"?><records><record/></records>"
                        .getBytes(UTF_16LE));
        assertTypeByData("application/xml",
                "\uFEFF<?xml version=\"1.0\" encoding=\"UTF-16\"?><records><record/></records>"
                        .getBytes(UTF_16BE));
        assertTypeByData("application/xml",
                "<!-- XML without processing instructions --><records><record/></records>"
                        .getBytes(UTF_8));
        assertTypeByData("text/html", "<html><body>HTML</body></html>".getBytes(UTF_8));
        assertTypeByData("text/html",
                "<!-- HTML comment --><html><body>HTML</body></html>".getBytes(UTF_8));
    }
Formats which are based on plain text
tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/java/org/apache/tika/mime/TestMimeTypes.java