diff --git a/README.txt b/README.txt
index d5b58b1..87f8a7e 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 hirachy.
+
 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..d548ac3 100644
--- a/restws.entity.inc
+++ b/restws.entity.inc
@@ -177,26 +177,38 @@ class RestWSEntityResourceController implements RestWSResourceControllerInterfac
    * Implements RestWSResourceControllerInterface::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);
+    $start = 0;
 
     $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']:
+          $start = $value > 0 ? $value : $start;
           break;
       }
     }
 
+    // Calculate the offset.
+    $start *= $limit;
+    $query->range($start, $limit);
+
     // Catch any errors, like wrong keywords or properties.
     try {
       $query_result = $query->execute();
@@ -211,6 +223,44 @@ class RestWSEntityResourceController implements RestWSResourceControllerInterfac
     return $result;
   }
 
+  /**
+   * Returns the number of resources available with the given filters.
+   *
+   * @param array $filters
+   *   A list of properties to query for, or an empty array if all resources
+   *   should be returned.
+   *
+   * @return integer
+   *   The number of resources available.
+   */
+  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();
+  }
+
+  /**
+   * 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 limit(array $meta_controls = array()) {
+    $rest_controls = restws_meta_controls();
+    $limit = variable_get('restws_query_max_limit', 100);
+    return (isset($meta_controls[$rest_controls['limit']]) ? $meta_controls[$rest_controls['limit']] : $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..3d2c5c1 100644
--- a/restws.formats.inc
+++ b/restws.formats.inc
@@ -140,6 +140,18 @@ abstract class RestWSBaseFormat implements RestWSFormatInterface {
     $result = $this->query($resourceController);
 
     $values = array();
+
+    $values['self'] = $this->generateQueryURI($resourceController, 'self');
+    $values['first'] = $this->generateQueryURI($resourceController, 'first');
+    $values['last'] = $this->generateQueryURI($resourceController, 'last');
+    if (($prev = $this->generateQueryURI($resourceController, 'prev')) != FALSE) {
+      $values['prev'] = $prev;
+    }
+    if (($next = $this->generateQueryURI($resourceController, 'next')) != FALSE) {
+      $values['next'] = $next;
+    }
+
+
     foreach ($result as $id) {
       $values['list'][] = self::getData($resourceController->wrapper($id));
     }
@@ -336,7 +348,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 +360,65 @@ abstract class RestWSBaseFormat implements RestWSFormatInterface {
     }
     return array('meta_controls' => $meta_controls, 'filters' => $filters);
   }
+
+  /**
+   * Generates navigation links for querying.
+   *
+   * @param RestWSResourceControllerInterface $resourceController
+   *   The controller used to query the resource.
+   *
+   * @param string $rel
+   *   Either self, prev, next, first or last defining the relationship to the
+   *   current page.
+   *
+   * @return bool|string
+   *   Either a string with the uri or FALSE if not available.
+   *
+   * @throws RestWSException
+   *   If the page is out of range the function will throw a new RestWSException
+   *   with HTTP status code 404.
+   */
+  protected function generateQueryURI($resourceController, $rel) {
+    $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);
+    }
+    switch ($rel) {
+      case 'prev':
+        if ($page == 0) {
+          return FALSE;
+        }
+        $parameters['page'] = $page - 1;
+        break;
+
+      case 'next':
+        if ($page == $last) {
+          return FALSE;
+        }
+        $parameters['page'] = $page + 1;
+        break;
+
+      case 'first':
+        $parameters['page'] = 0;
+        break;
+
+      case 'last':
+        $parameters['page'] = $last;
+        break;
+    }
+
+    return url($resourceController->resource(), array('absolute' => TRUE, 'alias' => TRUE, 'query' => $parameters));
+  }
 }
 
 /**
@@ -423,6 +494,12 @@ class RestWSFormatXML extends RestWSBaseFormat {
     $xml = new DOMDocument('1.0', 'utf-8');
     $element = $xml->createElement('list');
 
+    $this->appendQueryLink($xml, $element, $resourceController, 'self');
+    $this->appendQueryLink($xml, $element, $resourceController, 'first');
+    $this->appendQueryLink($xml, $element, $resourceController, 'last');
+    $this->appendQueryLink($xml, $element, $resourceController, 'prev');
+    $this->appendQueryLink($xml, $element, $resourceController, 'next');
+
     $values = $this->query($resourceController);
     foreach ($values as $id) {
       $item = $xml->createElement($resourceController->resource());
@@ -434,6 +511,32 @@ class RestWSFormatXML extends RestWSBaseFormat {
     return $xml->saveXML();
   }
 
+  /**
+   * Adds a query link uri to the given element with given relation ship.
+   *
+   * @param DOMDocument $xml
+   *   The document which creates the elements.
+   *
+   * @param DOMNode $parent
+   *   Parent node on which the uri elements should be append.
+   *
+   * @param RestWSResourceControllerInterface $resourceController
+   *   The controller used to query the resource.
+   *
+   * @param string $rel
+   *   The relation ship to the current page @see
+   *   RestWSBaseFormat::generateQueryURI().
+   */
+  protected function appendQueryLink(DOMDocument $xml, DOMNode $parent, RestWSResourceControllerInterface $resourceController, $rel) {
+    $item = $xml->createElement('link');
+    $item->setAttribute('rel', $rel);
+    if (($content = $this->generateQueryURI($resourceController, $rel)) != FALSE) {
+      $uri = $xml->createTextNode($content);
+      $item->appendChild($uri);
+      $parent->appendChild($item);
+    }
+  }
+
   public function serialize($data) {
     // Return an empty XML document.
     $xml = new DOMDocument('1.0', 'utf-8');
diff --git a/restws.module b/restws.module
index 48898e6..2fc0fe6 100644
--- a/restws.module
+++ b/restws.module
@@ -405,5 +405,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..d73ff74 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(isset($result_nodes['self']), 'Self link was generated');
+    $this->assertTrue(isset($result_nodes['first']), 'First link was generated');
+    $this->assertTrue(isset($result_nodes['last']), 'Last link was generated');
+    $this->assertTrue(isset($result_nodes['next']), 'Next link was generated');
+    $this->assertFalse(isset($result_nodes['prev']), 'Prev link was 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.');
   }
 
   /**
