    @Test
    public void testExtractFromXml() throws IOException {

        File tempDir = null;

        try {
            tempDir = FileUtil.createTemporaryDirectory("test-xml");
            File testFile = new File(tempDir, "test.xml");
            FileUtil.writeFile(testFile, getBytes("test.xml"));

            Assert.assertEquals(
                    "Failed XmlUtil.extractFromXml for XPath '/a/bs/b[1]/@attr1'.",
                    "attr1v1", XmlUtil.extractFromXml(testFile, "/a/bs/b[1]/@attr1", String.class)
            );

            Assert.assertEquals(
                    "Failed XmlUtil.extractFromXml for XPath '/a/bs/b[2]/@attr1'.",
                    "attr1v2", XmlUtil.extractFromXml(testFile, "/a/bs/b[2]/@attr1", String.class)
            );

            Assert.assertEquals(
                    "Failed XmlUtil.extractFromXml for XPath '/a/bs/b[@attr1='attr1v1']/@attr2'.",
                    "attr2v1", XmlUtil.extractFromXml(testFile, "/a/bs/b[@attr1='attr1v1']/@attr2", String.class)
            );

            Assert.assertEquals(
                    "Failed XmlUtil.extractFromXml for XPath '/a/bs/b[@attr1='attr1v1']/@attr3'.",
                    Integer.valueOf(1), XmlUtil.extractFromXml(testFile, "/a/bs/b[@attr1='attr1v1']/@attr3", Integer.class)
            );

            Assert.assertEquals(
                    "Failed XmlUtil.extractFromXml for XPath '/a/d/@attr6'.",
                    "attr6v", XmlUtil.extractFromXml(testFile, "/a/d/@attr6", String.class)
            );
        } finally {
            FileUtil.deleteTotallyAsync(tempDir);
        }
    }