diff --git a/ndn-cpp/name.cpp b/ndn-cpp/name.cpp
index 1eb25de..4e27db1 100644
--- a/ndn-cpp/name.cpp
+++ b/ndn-cpp/name.cpp
@@ -224,6 +224,19 @@
     addComponent(nameStruct.components[i].value, nameStruct.components[i].valueLength);  
 }
 
+Name&
+Name::append(const Name& name)
+{
+  if (&name == this)
+    // Copying from this name, so need to make a copy first.
+    return append(Name(name));
+
+  for (size_t i = 0; i < name.components_.size(); ++i)
+    components_.push_back(name.components_[i]);
+  
+  return *this;
+}
+
 std::string 
 Name::toUri() const
 {
diff --git a/ndn-cpp/name.hpp b/ndn-cpp/name.hpp
index 1a1cf53..2fed5ba 100644
--- a/ndn-cpp/name.hpp
+++ b/ndn-cpp/name.hpp
@@ -171,53 +171,93 @@
 
   /**
    * Append a new component, copying from value of length valueLength.
+   * @return This name so that you can chain calls to append.
    */
-  void 
-  appendComponent(const unsigned char *value, unsigned int valueLength) 
+  Name& 
+  append(const unsigned char *value, unsigned int valueLength) 
   {
     components_.push_back(Component(value, valueLength));
+    return *this;
   }
 
   /**
    * Append a new component, copying from value.
+   * @return This name so that you can chain calls to append.
    */
-  void 
-  appendComponent(const std::vector<unsigned char>& value) 
+  Name& 
+  append(const std::vector<unsigned char>& value) 
   {
     components_.push_back(value);
+    return *this;
   }
   
-  void 
-  appendComponent(const Blob &value)
+  Name& 
+  append(const Blob &value)
   {
     components_.push_back(value);
+    return *this;
   }
   
   /**
-   * @deprecated Use appendComponent.
+   * Append the components of the given name to this name.
+   * @param name The Name with components to append.
+   * @return This name so that you can chain calls to append.
    */
-  void 
-  addComponent(const unsigned char *value, unsigned int valueLength) 
+  Name&
+  append(const Name& name);
+  
+  /**
+   * @deprecated Use append.
+   */
+  Name& 
+  appendComponent(const unsigned char *value, unsigned int valueLength) 
   {
-    appendComponent(value, valueLength);
+    return append(value, valueLength);
   }
 
   /**
-   * @deprecated Use appendComponent.
+   * @deprecated Use append.
    */
-  void 
-  addComponent(const std::vector<unsigned char>& value) 
+  Name& 
+  appendComponent(const std::vector<unsigned char>& value) 
   {
-    appendComponent(value);
+    return append(value);
   }
   
   /**
-   * @deprecated Use appendComponent.
+   * @deprecated Use append.
    */
-  void 
+  Name& 
+  appendComponent(const Blob &value)
+  {
+    return append(value);
+  }
+
+  /**
+   * @deprecated Use append.
+   */
+  Name& 
+  addComponent(const unsigned char *value, unsigned int valueLength) 
+  {
+    return append(value, valueLength);
+  }
+
+  /**
+   * @deprecated Use append.
+   */
+  Name& 
+  addComponent(const std::vector<unsigned char>& value) 
+  {
+    return append(value);
+  }
+  
+  /**
+   * @deprecated Use append.
+   */
+  Name& 
   addComponent(const Blob &value)
   {
-    appendComponent(value);
+    return append(value);
   }
   
   /**
@@ -283,15 +323,17 @@
   {
     return toUri();
   }
-  
+
   /**
    * Append a component with the encoded segment number.
    * @param segment The segment number.
-   */
-  void 
+   * @return This name so that you can chain calls to append.
+   */  
+  Name& 
   appendSegment(unsigned long segment)
   {
     components_.push_back(Component(Component::makeSegment(segment)));
+    return *this;
   }
   
   /**
