See xz manual
# compress a directory
XZ_OPT='-9' tar -chvJf output-file.tar.xz -C /your/dir .
# The output archive of the above command doesn't contain the root directory.
# To compress a directory with its name in the output archive, use below command:
cd /your
XZ_OPT='-9' tar -chvJf output-file.tar.xz dir
# decompress to the current directory.
tar -xvJf tomcat.tar.xz