Creating the xpath library seperately

diff --git a/axiom/configure.ac b/axiom/configure.ac
index 576675d..22af67b 100644
--- a/axiom/configure.ac
+++ b/axiom/configure.ac
@@ -79,7 +79,21 @@
 dnl AC_FUNC_REALLOC
 #AC_CHECK_FUNCS([memmove])
 
+AC_MSG_CHECKING(whether to build xpath)
+AC_ARG_ENABLE(xpath, [  --enable-xpath    build xpath. default=yes],
+[ case "${enableval}" in
+  no)
+    AC_MSG_RESULT(no)
+    ;;
+  *)
+    AC_MSG_RESULT(yes)
+    XPATH_DIR="xpath"
 
+    ;;
+  esac ],
+  AC_MSG_RESULT(yes)
+  XPATH_DIR="xpath"
+)
 
 AC_MSG_CHECKING(whether to build guththila xml parser library)
 AC_ARG_ENABLE(guththila, [  --enable-guththila    build guththila xml parser library wrapper. default=yes],
@@ -142,6 +156,7 @@
 AC_SUBST(WRAPPER_DIR)
 AC_SUBST(GUTHTHILA_LIBS)
 AC_SUBST(TESTDIR)
+AC_SUBST(XPATH_DIR)
 
 AC_CONFIG_FILES([Makefile \
     src/Makefile \
diff --git a/axiom/src/Makefile.am b/axiom/src/Makefile.am
index 7588124..0b2362b 100644
--- a/axiom/src/Makefile.am
+++ b/axiom/src/Makefile.am
@@ -1 +1 @@
-SUBDIRS = parser attachments soap util xpath om
+SUBDIRS = parser attachments soap util ${XPATH_DIR} om
diff --git a/axiom/src/om/Makefile.am b/axiom/src/om/Makefile.am
index daaa595..40db6c5 100644
--- a/axiom/src/om/Makefile.am
+++ b/axiom/src/om/Makefile.am
@@ -18,7 +18,6 @@
                         om_navigator.c
 
 libaxis2_axiom_la_LIBADD =	$(top_builddir)/src/soap/libaxis2_soap.la \
-				$(top_builddir)/src/xpath/libaxis2_xpath.la \
 				$(top_builddir)/src/attachments/libaxis2_attachments.la \
                     		$(top_builddir)/src/util/libaxis2_axiom_util.la \
 							../parser/${WRAPPER_DIR}/libaxis2_parser.la \
diff --git a/axiom/src/xpath/Makefile.am b/axiom/src/xpath/Makefile.am
index 4a76294..5cf944e 100644
--- a/axiom/src/xpath/Makefile.am
+++ b/axiom/src/xpath/Makefile.am
@@ -1,4 +1,4 @@
-noinst_LTLIBRARIES = libaxis2_xpath.la
+lib_LTLIBRARIES = libaxis2_xpath.la
 libaxis2_xpath_la_SOURCES = xpath.c \
 			xpath_functions.c \
 			xpath_internals.c \
diff --git a/configure.ac b/configure.ac
index 4b2efff..64e1369 100644
--- a/configure.ac
+++ b/configure.ac
@@ -133,6 +133,21 @@
   AC_MSG_RESULT(no)
 )
 
+AC_MSG_CHECKING(whether to build xpath)
+AC_ARG_ENABLE(xpath, [  --enable-xpath    build xpath. default=yes],
+[ case "${enableval}" in
+  no)
+    AC_MSG_RESULT(no)
+    ;;
+  *)
+    AC_MSG_RESULT(yes)
+    XPATH_DIR="xpath"
+
+    ;;
+  esac ],
+  AC_MSG_RESULT(yes)
+  XPATH_DIR="xpath"
+)
 
 GUTHTHILA_LIBS=""