diff --git a/.gitignore b/.gitignore
index 8d0685eef57a8904f5545acfd597515547481377..f9de06411294751fe8ca11047da90944a5262247 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,3 +11,4 @@ src
 develop-eggs
 built-docs
 dist
+sphinx
diff --git a/buildout.cfg b/buildout.cfg
index bb063d7b066455b544adf990d90ba4d830146b6b..efd3f488183c90914accd279ea604177d1f1b699 100644
--- a/buildout.cfg
+++ b/buildout.cfg
@@ -13,7 +13,7 @@ versions = versions
 ;current sys.path settings. Also note that your current 'eggs' directory may
 ;not take precedence over that.
 eggs = bob==master
-       bob.db.replay
+       xbob.db.replay
 
 [versions]
 ;If you would like to pin-down the recipes package version so you are not
diff --git a/docs/conf.py b/docs/conf.py
index 80c095340f6f3d23140b71940690a136d1531908..dbaac04bf3e8838ac131953503b15bb7032df96f 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -77,10 +77,10 @@ copyright = u'%s, Idiap Research Institute' % time.strftime('%Y')
 # built documents.
 #
 # The short X.Y version.
-from replay.db import version as db_version
-version = db_version()
+from xbob.db.replay.driver import Interface
+version = Interface().version()
 # The full version, including alpha/beta/rc tags.
-release = db_version()
+release = version
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff --git a/docs/index.rst b/docs/index.rst
index af04bc5c8b7ccdf70c4a5715fc7999f289655b23..52b3f615a49312bb04a7c1f54eb4f9dd8fb4e4b9 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -6,6 +6,6 @@
  Replay Attack Database
 ========================
 
-.. automodule:: replay.db
+.. automodule:: xbob.db.replay
 
-.. autoclass:: replay.db.Database
+.. autoclass:: xbob.db.replay.Database
diff --git a/replay/__init__.py b/replay/__init__.py
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/setup.py b/setup.py
index ad0322df27f3c8d4b8ca21df3c585d61fbf4ac17..21031547af2579005203fd48c297b4bbd509975a 100644
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,7 @@ from setuptools import setup, find_packages
 # parameters that define our package.
 setup(
 
-    name='bob.db.replay',
+    name='xbob.db.replay',
     version='master',
     description='Replay Attack Database Access API for Bob',
     url='http://github.com/bioidiap/bob.db.replay',
@@ -24,23 +24,24 @@ setup(
     zip_safe=False,
 
     install_requires=[
-        "bob",  # base signal proc./machine learning library
+      'setuptools',
+      'bob',  # base signal proc./machine learning library
     ],
 
-    entry_points={
-      'console_scripts': [
-        # for tests or db creation, enable the following line:
-        #'replay_manager.py = bob.db.script.dbmanage:main',
-        ],
-      
+    namespace_packages = [
+      'xbob',
+      'xbob.db',
+      ],
+
+    entry_points = {
       # bob database declaration
       'bob.db': [
-        'replay = replay.db.driver:Interface',
+        'replay = xbob.db.replay.driver:Interface',
         ],
 
       # bob unittest declaration
       'bob.test': [
-        'replay = replay.test:ReplayDatabaseTest',
+        'replay = xbob.db.replay.test:ReplayDatabaseTest',
         ],
       },
 
diff --git a/xbob/__init__.py b/xbob/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..60381ea9b78a067c402bf65368cc63241b0d7456
--- /dev/null
+++ b/xbob/__init__.py
@@ -0,0 +1,2 @@
+#see http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+__import__('pkg_resources').declare_namespace(__name__)
diff --git a/xbob/db/__init__.py b/xbob/db/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..60381ea9b78a067c402bf65368cc63241b0d7456
--- /dev/null
+++ b/xbob/db/__init__.py
@@ -0,0 +1,2 @@
+#see http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+__import__('pkg_resources').declare_namespace(__name__)
diff --git a/replay/db/__init__.py b/xbob/db/replay/__init__.py
similarity index 97%
rename from replay/db/__init__.py
rename to xbob/db/replay/__init__.py
index 86d7424ab33bfd6aca0bb80385198f2fd1122da1..13cb82ff5ce91cb77da3e2361a8fd0466ba3e695 100644
--- a/replay/db/__init__.py
+++ b/xbob/db/replay/__init__.py
@@ -25,4 +25,5 @@ on your references:
 """
 
 from .query import Database
-__all__ = dir()
+
+__all__ = ['Database']
diff --git a/replay/db/checkfiles.py b/xbob/db/replay/checkfiles.py
similarity index 100%
rename from replay/db/checkfiles.py
rename to xbob/db/replay/checkfiles.py
diff --git a/replay/db/create.py b/xbob/db/replay/create.py
similarity index 100%
rename from replay/db/create.py
rename to xbob/db/replay/create.py
diff --git a/replay/db/driver.py b/xbob/db/replay/driver.py
similarity index 98%
rename from replay/db/driver.py
rename to xbob/db/replay/driver.py
index 8e1b5af668ba57448fca321281517e44772578a4..9d6e9d6c5c8e1b1dce01a477c33ceef27645c2d0 100644
--- a/replay/db/driver.py
+++ b/xbob/db/replay/driver.py
@@ -81,7 +81,7 @@ class Interface(BaseInterface):
 
   def version(self):
     import pkg_resources  # part of setuptools
-    return pkg_resources.require('bob.db.%s' % self.name())[0].version
+    return pkg_resources.require('xbob.db.%s' % self.name())[0].version
 
   def location(self):
     return os.path.dirname(os.path.realpath(__file__))
diff --git a/replay/db/dumplist.py b/xbob/db/replay/dumplist.py
similarity index 100%
rename from replay/db/dumplist.py
rename to xbob/db/replay/dumplist.py
diff --git a/replay/db/models.py b/xbob/db/replay/models.py
similarity index 100%
rename from replay/db/models.py
rename to xbob/db/replay/models.py
diff --git a/replay/db/query.py b/xbob/db/replay/query.py
similarity index 100%
rename from replay/db/query.py
rename to xbob/db/replay/query.py
diff --git a/replay/test.py b/xbob/db/replay/test.py
similarity index 100%
rename from replay/test.py
rename to xbob/db/replay/test.py