diff --git a/xml/transformLFGravity.sh b/xml/transformLFGravity.sh
new file mode 100755
index 0000000000000000000000000000000000000000..cf633cc6be5d8306330974bb1286ec69e64469c6
--- /dev/null
+++ b/xml/transformLFGravity.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+
+#set -x
+
+sub_path=//OpenGeoSysProject/processes/process
+
+axis_id=`xmlstarlet sel -t -m "/${sub_path}/darcy_gravity" -v "./axis_id" $1`
+echo "read axis id: $axis_id"
+g=`xmlstarlet sel -t -m "//*/darcy_gravity" -v "./g" $1`
+echo "read gravity value: $g"
+
+### add specific body force
+if (( $axis_id == 0 )); then
+    xmlstarlet ed --subnode $sub_path --type elem -n "specific_body_force" -v "-$g 0.0 0.0" $1 > /tmp/specific_body_force_added.prj
+elif (( $axis_id == 1 )); then
+    xmlstarlet ed --subnode $sub_path --type elem -n "specific_body_force" -v "0.0 -$g 0.0" $1 > /tmp/specific_body_force_added.prj
+elif (( $axis_id == 2 )); then
+    xmlstarlet ed --subnode $sub_path --type elem -n "specific_body_force" -v "0.0 0.0 -$g" $1 > /tmp/specific_body_force_added.prj
+fi
+
+### remove darcy_gravity tag
+xmlstarlet ed --delete "$sub_path/darcy_gravity" /tmp/specific_body_force_added.prj > /tmp/cleanup.prj
+
+#format the result file
+xmlstarlet fo -s 4 /tmp/cleanup.prj > ${1}
+rm /tmp/specific_body_force_added.prj
+rm /tmp/cleanup.prj