+# Check for Google Test and if it exists, enable the tests.
+
+AC_LANG_PUSH([C++])
+AC_CHECK_HEADERS([gtest/gtest.h], [gtestfound=yes], [gtestfound=no])
+AC_LANG_POP([C++])
+
+# libxml2 Library
+
+CPPFLAGSOLD=CPPFLAGS
+CPPFLAGS=`xml2-config --cflags`
+
+AC_CHECK_PROG([FOUND_XML2CONFIG], [xml2-config], [yes], [no])
+AM_CONDITIONAL([FOUND_XML2CONFIG_RES], [test x$FOUND_XML2CONFIG = xyes])
+
+AM_COND_IF([FOUND_XML2CONFIG_RES], [], [echo "Cannot find the xml2-config program on your system.
+If it is installed on your system, adjust your PATH environment
+variable before running configure again."
+ exit -1
+ ])
+
+AC_CHECK_LIB([xml2], [main], [], [echo "The libxml2 library must be installed on your system.
+Please check that this library is installed properly before
+running configure again."
+ exit -1
+ ])
+
+AC_CHECK_HEADERS([libxml2/libxml/parser.h libxml2/libxml/tree.h], [], [echo "The libxml2 library headers must be installed on your system.
+Please check that the library headers are installed properly
+before running configure again."
+ exit -1
+ ])
+
+CPPFLAGS=CPPFLAGSOLD
+