diff --git a/README.txt b/README.txt
index d5b58b1..3971eb6 100644
--- a/README.txt
+++ b/README.txt
@@ -118,6 +118,9 @@ not supported.
 If a certain property isn't valid an HTTP status code 412 will be returned
 containing an error message.
 
+Meta Controls
+-------------
+
 Additionally to the filters RestWS also supports meta controls, which allow you
 to control your output. Currently only sort and direction are supported.
 This two meta controls allow you to sort your output by a specific property of
@@ -127,6 +130,16 @@ DESC for the meta control direction.
 
 /taxonomy_term.json?sort=tid&direction=DESC
 
+You can limit the results with the meta control limit which is by default 100.
+To navigate through the generated pages, you have to use meta control page.
+
+/node.json?limit=10&page=3
+
+The output always has a self, a first and a last element, which contain a link
+to the current, first and last page. If your current page isn't the last or the
+first one, RestWS will also generate prev and next links. For xml they can be
+found in the tags <link /> in the first hierarchy.
+
 If one of your resource properties collides with one of RestWS meta control
 keywords, you have prefix it with property_, when specifying it as filter.
 
diff --git a/restws.entity.inc b/restws.entity.inc
index 4e0fc2f..0cd1e6f 100644
--- a/restws.entity.inc
+++ b/restws.entity.inc
@@ -70,10 +70,29 @@ interface RestWSResourceControllerInterface {
   public function delete($id);
 
   /**
-   * Query for a list of resources.
+   * Determines access for a given operation and resource.
    *
-   * If a resource doesn't want to implement querying, then it should throw a
-   * RestWSException with the 501 HTTP status code.
+   * @param string $op
+   *   Either 'create', 'view' (= read), 'update' or 'delete'.
+   * @param int|string $id
+   *   The id of the resource.
+   *
+   * @see entity_access()
+   */
+  public function access($op, $id);
+
+  /**
+   * Returns the name of the resource.
+   */
+  public function resource();
+}
+
+/**
+ * Specifies query methods for resources.
+ */
+interface RestWSQueryResourceControllerInterface {
+  /**
+   * Query for a list of resources.
    *
    * @param array $filters
    *   A list of properties to query for, or an empty array if all resources
@@ -87,27 +106,34 @@ interface RestWSResourceControllerInterface {
   public function query($filters = array(), $meta_controls = array());
 
   /**
-   * Determines access for a given operation and resource.
+   * Returns the number of resources available with the given filters.
    *
-   * @param string $op
-   *   Either 'create', 'view' (= read), 'update' or 'delete'.
-   * @param int|string $id
-   *   The id of the resource.
+   * @param array $filters
+   *   A list of properties to query for, or an empty array if all resources
+   *   should be returned.
    *
-   * @see entity_access()
+   * @return integer
+   *   The number of resources available.
    */
-  public function access($op, $id);
+  public function count($filters = array());
 
   /**
-   * Returns the name of the resource.
+   * Returns the limit for the current query.
+   *
+   * @param array $meta_controls
+   *   Parameters which control the output of the query
+   *   @see restws_meta_controls()
+   *
+   * @return integer
+   *   The limit of the current limit.
    */
-  public function resource();
+  public function limit(array $meta_controls = array());
 }
 
 /**
  * Controller for entity-bases resources.
  */
-class RestWSEntityResourceController implements RestWSResourceControllerInterface {
+class RestWSEntityResourceController implements RestWSResourceControllerInterface, RestWSQueryResourceControllerInterface {
 
   protected $entityType, $entityInfo;
 
@@ -174,29 +200,41 @@ class RestWSEntityResourceController implements RestWSResourceControllerInterfac
   }
 
   /**
-   * Implements RestWSResourceControllerInterface::query().
+   * Implements RestWSQueryResourceControllerInterface::query().
    */
   public function query($filters = array(), $meta_controls = array()) {
-    $limit = variable_get("restws_query_max_limit", 100);
+    $limit = variable_get('restws_query_max_limit', 100);
+    $offset = 0;
 
-    $query =  new EntityFieldQuery();
+    $query = new EntityFieldQuery();
     $query->entityCondition('entity_type', $this->resource());
-    $query->pager($limit);
 
     foreach ($filters as $filter => $value) {
       $this->propertyQueryOperation($query, 'Condition', $filter, $value);
     }
 
     $rest_controls = restws_meta_controls();
-    foreach ($meta_controls as $control_name => $property) {
+    foreach ($meta_controls as $control_name => $value) {
       switch ($control_name) {
         case $rest_controls['sort']:
           $direction = isset($meta_controls[$rest_controls['direction']]) ? $meta_controls[$rest_controls['direction']] : 'ASC';
-          $this->propertyQueryOperation($query, 'OrderBy', $property, $direction);
+          $this->propertyQueryOperation($query, 'OrderBy', $value, $direction);
+          break;
+
+        case $rest_controls['limit']:
+          $limit = $value < $limit ? $value : $limit;
+          break;
+
+        case $rest_controls['page']:
+          $offset = $value > 0 ? $value : $offset;
           break;
       }
     }
 
+    // Calculate the offset.
+    $offset *= $limit;
+    $query->range($offset, $limit);
+
     // Catch any errors, like wrong keywords or properties.
     try {
       $query_result = $query->execute();
@@ -211,6 +249,36 @@ class RestWSEntityResourceController implements RestWSResourceControllerInterfac
     return $result;
   }
 
+
+  /**
+   * Implements RestWSQueryResourceControllerInterface::count().
+   */
+  public function count($filters = array()) {
+    $query = new EntityFieldQuery();
+    $query->entityCondition('entity_type', $this->resource());
+
+    foreach ($filters as $filter => $value) {
+      $this->propertyQueryOperation($query, 'Condition', $filter, $value);
+    }
+    $query->count();
+
+    return $query->execute();
+  }
+
+  /**
+   * Implements RestWSQueryResourceControllerInterface::limit().
+   */
+  public function limit(array $meta_controls = array()) {
+    $rest_controls = restws_meta_controls();
+    $limit = variable_get('restws_query_max_limit', 100);
+    if (isset($meta_controls[$rest_controls['limit']]) && $meta_controls[$rest_controls['limit']] < $limit) {
+      return $meta_controls[$rest_controls['limit']];
+    }
+    else {
+      return $limit;
+    }
+  }
+
   public function access($op, $id) {
     return entity_access($op, $this->entityType, isset($id) ? $this->wrapper($id)->value() : NULL);
   }
diff --git a/restws.formats.inc b/restws.formats.inc
index 230dfae..4a8c58c 100644
--- a/restws.formats.inc
+++ b/restws.formats.inc
@@ -139,7 +139,9 @@ abstract class RestWSBaseFormat implements RestWSFormatInterface {
   public function queryResource($resourceController, $payload) {
     $result = $this->query($resourceController);
 
-    $values = array();
+    $values = $this->generateQueryURIs($resourceController);
+
+
     foreach ($result as $id) {
       $values['list'][] = self::getData($resourceController->wrapper($id));
     }
@@ -336,7 +338,7 @@ abstract class RestWSBaseFormat implements RestWSFormatInterface {
     foreach ($parameters as $parameter => $value) {
       // Check if the property is prefixed.
       if (substr($parameter, 0, 9) == 'property_') {
-        $parameter = substr($parameter, 9, strlen($parameter)-9);
+        $parameter = substr($parameter, 9, strlen($parameter) - 9);
       }
 
       // If the parameter doesn't exist, we can not filter for and need to
@@ -348,6 +350,62 @@ abstract class RestWSBaseFormat implements RestWSFormatInterface {
     }
     return array('meta_controls' => $meta_controls, 'filters' => $filters);
   }
+
+  /**
+   * Generates all navigation links for querying.
+   *
+   * @param RestWSResourceControllerInterface $resourceController
+   *   The controller used to query the resource.
+   *
+   * @return array
+   *   An array containing all navigation links.
+   *
+   * @throws RestWSException
+   *   If the page is out of range the function will throw a new RestWSException
+   *   with HTTP status code 404.
+   */
+  protected function generateQueryURIs(RestWSResourceControllerInterface $resourceController) {
+    $parameters = drupal_get_query_parameters();
+    $rest_controls = restws_meta_controls();
+
+    $split_parameters = $this->splitParameters($resourceController->propertyInfo(), $parameters);
+
+    $count = $resourceController->count($split_parameters['filters']);
+    $limit = $resourceController->limit($split_parameters['meta_controls']);
+    $page = isset($parameters[$rest_controls['page']]) ? $parameters[$rest_controls['page']] : 0;
+
+    $last = ceil($count / $limit) - 1;
+
+    if ($page > $last || $page < 0) {
+      throw new RestWSException('Page doesn\'t exist.', 404);
+    }
+
+    $uris = array();
+    $options = array(
+      'absolute' => TRUE,
+      'alias' => TRUE,
+      'query' => &$parameters,
+    );
+
+    $uris['self'] = url($resourceController->resource(), $options);
+    $parameters['page'] = 0;
+    $uris['first'] = url($resourceController->resource(), $options);
+    $parameters['page'] = $last;
+    $uris['last'] = url($resourceController->resource(), $options);
+
+
+    if ($page != 0) {
+      $parameters['page'] = $page - 1;
+      $uris['prev'] = url($resourceController->resource(), $options);
+    }
+
+    if ($page != $last) {
+      $parameters['page'] = $page + 1;
+      $uris['next'] = url($resourceController->resource(), $options);
+    }
+
+    return $uris;
+  }
 }
 
 /**
@@ -423,6 +481,15 @@ class RestWSFormatXML extends RestWSBaseFormat {
     $xml = new DOMDocument('1.0', 'utf-8');
     $element = $xml->createElement('list');
 
+    $links = $this->generateQueryURIs($resourceController);
+
+    foreach ($links as $rel => $link) {
+      $item = $xml->createElement('link');
+      $item->setAttribute('rel', $rel);
+      $item->setAttribute('href', $link);
+      $element->appendChild($item);
+    }
+
     $values = $this->query($resourceController);
     foreach ($values as $id) {
       $item = $xml->createElement($resourceController->resource());
diff --git a/restws.module b/restws.module
index 48898e6..7e986cb 100644
--- a/restws.module
+++ b/restws.module
@@ -131,6 +131,9 @@ function restws_handle_request($op, $format, $resource_name, $id = NULL, $payloa
           drupal_add_http_header('Status', '201 Created');
         }
         elseif ($op == 'query') {
+          if (!$resource instanceof RestWSQueryResourceControllerInterface) {
+            throw new RestWSException('Quering not available for this resources', 501);
+          }
           print $format->$method($resource, $payload);
         }
         else {
@@ -405,5 +408,7 @@ function restws_meta_controls() {
   return array(
     'sort' => 'sort',
     'direction' => 'direction',
+    'page' => 'page',
+    'limit' => 'limit',
   );
 }
diff --git a/restws.test b/restws.test
index a68a218..e4a5b2e 100644
--- a/restws.test
+++ b/restws.test
@@ -266,6 +266,27 @@ class RestWSTestCase extends DrupalWebTestCase {
 
     $this->assertEqual($nodes['list'][1]['title'], 'node3', 'Right node title was received.');
     $this->assertEqual($nodes['list'][1]['field_tags'][0]['id'], 1, 'Node has taxonomy term.');
+
+    // Test paging and limiting.
+    $result = $this->httpRequest('node.json', 'GET', $account, array('limit' => 2, 'page' => 0));
+    $result_nodes = drupal_json_decode($result);
+
+    $this->assertTrue(count($result_nodes['list'] > 2), 'Only two elements where returned');
+
+    $this->assertTrue($result_nodes['self'] == url('node', array('absolute' => TRUE, 'query' => array('limit' => 2, 'page' => 0))), 'Self link was generated');
+    $this->assertTrue($result_nodes['first'] == url('node', array('absolute' => TRUE, 'query' => array('limit' => 2, 'page' => 0))), 'First link was generated');
+    $this->assertTrue($result_nodes['last'] == url('node', array('absolute' => TRUE, 'query' => array('limit' => 2, 'page' => 2))), 'Last link was generated');
+    $this->assertTrue($result_nodes['next'] == url('node', array('absolute' => TRUE, 'query' => array('limit' => 2, 'page' => 1))), 'Next link was generated');
+    $this->assertFalse(isset($result_nodes['prev']), 'Prev link was not generated');
+
+    $result = $this->httpRequest('node.json', 'GET', $account, array('limit' => 2, 'page' => 2));
+    $result_nodes = drupal_json_decode($result);
+
+    $this->assertFalse(isset($result_nodes['next']), 'Next link was generated');
+    $this->assertTrue(isset($result_nodes['prev']), 'Prev link was generated');
+
+    $result = $this->httpRequest('node.json', 'GET', $account, array('limit' => 2, 'page' => 5));
+    $this->assertResponse('404', 'HTTP response code is correct.');
   }
 
   /**
