diff --git a/ndn-cpp/c/Interest.h b/ndn-cpp/c/Interest.h
index 57c340f..81d9bce 100644
--- a/ndn-cpp/c/Interest.h
+++ b/ndn-cpp/c/Interest.h
@@ -12,6 +12,55 @@
 extern "C" {
 #endif
 
+typedef enum {
+  ndn_Exclude_COMPONENT = 0,
+  ndn_Exclude_ANY = 1  
+} ndn_ExcludeType;
+
+/**
+ * An ndn_ExcludeEntry holds an ndn_ExcludeType, and if it is a COMPONENT, it holds a pointer to the component value.
+ */
+struct ndn_ExcludeEntry {
+  ndn_ExcludeType type;
+  unsigned char *component;     /**< pointer to the pre-allocated buffer for the component value */
+  unsigned int componentLength; /**< the number of bytes in value */
+};
+
+/**
+ * 
+ * @param self pointer to the ndn_NameComponent struct
+ * @param type one of the ndn_ExcludeType enum
+ * @param component the pre-allocated buffer for the component value, only used if type is ndn_Exclude_COMPONENT
+ * @param componentLength the number of bytes in value, only used if type is ndn_Exclude_COMPONENT
+ */
+static inline void ndn_ExcludeEntry_init(struct ndn_ExcludeEntry *self, ndn_ExcludeType type, unsigned char *component, unsigned int componentLength) 
+{
+  self->type = type;
+  self->component = component;
+  self->componentLength = componentLength;
+}
+
+/**
+ * An ndn_Exclude holds an array of ndn_ExcludeEntry.
+ */
+struct ndn_Exclude {
+  struct ndn_ExcludeEntry *entries;  /**< pointer to the array of entries. */
+  unsigned int maxEntries;           /**< the number of elements in the allocated entries array */
+  unsigned int nEntries;             /**< the number of entries in the exclude, 0 for no exclude */
+};
+/**
+ * Initialize an ndn_Exclude struct with the entries array.
+ * @param self pointer to the ndn_Exclude struct
+ * @param entries the pre-allocated array of ndn_ExcludeEntry
+ * @param maxEntries the number of elements in the allocated entries array
+ */
+static inline void ndn_Exclude_init(struct ndn_Exclude *self, struct ndn_ExcludeEntry *entries, unsigned int maxEntries) 
+{
+  self->entries = entries;
+  self->maxEntries = maxEntries;
+  self->nEntries = 0;
+}
+
 enum {
   ndn_Interest_CHILD_SELECTOR_LEFT = 0,
   ndn_Interest_CHILD_SELECTOR_RIGHT = 1,
@@ -29,7 +78,7 @@
 	int maxSuffixComponents;  /**< -1 for none */
 	unsigned char *publisherPublicKeyDigest;      /**< pointer to pre-allocated buffer.  0 for none */
   unsigned int publisherPublicKeyDigestLength; /**< length of publisherPublicKeyDigest.  0 for none */
-	// TODO: implement exclude
+	struct ndn_Exclude exclude;
 	int childSelector;        /**< -1 for none */
 	int answerOriginKind;     /**< -1 for none */
 	int scope;                /**< -1 for none */
@@ -38,14 +87,25 @@
   unsigned int nonceLength; /**< length of nonce.  0 for none */
 };
 
-static inline void ndn_Interest_init(struct ndn_Interest *self, struct ndn_NameComponent *nameComponents, unsigned int maxNameComponents) 
+/**
+ * Initialize an ndn_Interest_init struct with the pre-allocated nameComponents and excludeEntries,
+ * and defaults for all the values.
+ * @param self pointer to the ndn_Interest struct
+ * @param nameComponents the pre-allocated array of ndn_NameComponent
+ * @param maxNameComponents the number of elements in the allocated nameComponents array
+ * @param excludeEntries the pre-allocated array of ndn_ExcludeEntry
+ * @param maxExcludeEntries the number of elements in the allocated excludeEntries array
+ */
+static inline void ndn_Interest_init
+  (struct ndn_Interest *self, struct ndn_NameComponent *nameComponents, unsigned int maxNameComponents,
+   struct ndn_ExcludeEntry *excludeEntries, unsigned int maxExcludeEntries) 
 {
   ndn_Name_init(&self->name, nameComponents, maxNameComponents);
 	self->minSuffixComponents = -1;
   self->maxSuffixComponents = -1;
 	self->publisherPublicKeyDigest = 0;
 	self->publisherPublicKeyDigestLength = 0;
-	// TODO: implement exclude
+  ndn_Exclude_init(&self->exclude, excludeEntries, maxExcludeEntries);
 	self->childSelector = -1;
 	self->answerOriginKind = -1;
 	self->scope = -1;
diff --git a/ndn-cpp/c/encoding/BinaryXMLInterest.c b/ndn-cpp/c/encoding/BinaryXMLInterest.c
index 7939556..b9de3d6 100644
--- a/ndn-cpp/c/encoding/BinaryXMLInterest.c
+++ b/ndn-cpp/c/encoding/BinaryXMLInterest.c
@@ -9,6 +9,115 @@
 #include "BinaryXMLName.h"
 #include "BinaryXMLInterest.h"
 
+static ndn_Error encodeExclude(struct ndn_Exclude *exclude, struct ndn_BinaryXMLEncoder *encoder)
+{
+  if (exclude->nEntries == 0)
+    return;
+  
+  ndn_Error error;
+  if (error = ndn_BinaryXMLEncoder_writeElementStartDTag(encoder, ndn_BinaryXML_DTag_Exclude))
+    return error;
+  
+  // TODO: Do we want to order the components (except for ANY)?
+  unsigned int i;
+  for (i = 0; i < exclude->nEntries; ++i) {
+    struct ndn_ExcludeEntry *entry = &exclude->entries[i];
+    
+    if (entry->type == ndn_Exclude_COMPONENT) {
+      if (error = ndn_BinaryXMLEncoder_writeBlobDTagElement
+          (encoder, ndn_BinaryXML_DTag_Component, entry->component, entry->componentLength))
+        return error;
+    }
+    else if (entry->type == ndn_Exclude_ANY) {
+      if (error = ndn_BinaryXMLEncoder_writeElementStartDTag(encoder, ndn_BinaryXML_DTag_Any))
+        return error;
+    	if (error = ndn_BinaryXMLEncoder_writeElementClose(encoder))
+        return error;
+    }
+    else
+      return NDN_ERROR_unrecognized_ndn_ExcludeType;
+	}
+  
+	if (error = ndn_BinaryXMLEncoder_writeElementClose(encoder))
+    return error;
+  
+  return 0;  
+}
+
+static ndn_Error decodeExclude(struct ndn_Exclude *exclude, struct ndn_BinaryXMLDecoder *decoder)
+{
+  ndn_Error error;
+  if (error = ndn_BinaryXMLDecoder_readElementStartDTag(decoder, ndn_BinaryXML_DTag_Exclude))
+    return error;
+    
+  exclude->nEntries = 0;
+  while (1) {
+    int gotExpectedTag;
+    
+    if (error = ndn_BinaryXMLDecoder_peekDTag(decoder, ndn_BinaryXML_DTag_Component, &gotExpectedTag))
+      return error;    
+    if (gotExpectedTag) {
+      // Component
+      unsigned char *component;
+      unsigned int componentLen;
+      if (error = ndn_BinaryXMLDecoder_readBinaryDTagElement(decoder, ndn_BinaryXML_DTag_Component, 0, &component, &componentLen))
+        return error;
+    
+      // Add the component entry.
+      if (exclude->nEntries >= exclude->maxEntries)
+        return NDN_ERROR_read_an_entry_past_the_maximum_number_of_entries_allowed_in_the_exclude;
+      ndn_ExcludeEntry_init(exclude->entries + exclude->nEntries, ndn_Exclude_COMPONENT, component, componentLen);
+      ++exclude->nEntries;
+
+      continue;
+    }
+    
+    if (error = ndn_BinaryXMLDecoder_peekDTag(decoder, ndn_BinaryXML_DTag_Any, &gotExpectedTag))
+      return error;    
+    if (gotExpectedTag) {
+      // Any
+      if (error = ndn_BinaryXMLDecoder_readElementStartDTag(decoder, ndn_BinaryXML_DTag_Any))
+        return error;
+      if (error = ndn_BinaryXMLDecoder_readElementClose(decoder))
+        return error;
+    
+      // Add the any entry.
+      if (exclude->nEntries >= exclude->maxEntries)
+        return NDN_ERROR_read_an_entry_past_the_maximum_number_of_entries_allowed_in_the_exclude;
+      ndn_ExcludeEntry_init(exclude->entries + exclude->nEntries, ndn_Exclude_ANY, 0, 0);
+      ++exclude->nEntries;
+
+      continue;
+    }
+    
+    if (error = ndn_BinaryXMLDecoder_peekDTag(decoder, ndn_BinaryXML_DTag_Bloom, &gotExpectedTag))
+      return error;    
+    if (gotExpectedTag) {
+      // Skip the Bloom and treat it as Any.
+      unsigned char *value;
+      unsigned int valueLen;
+      if (error = ndn_BinaryXMLDecoder_readBinaryDTagElement(decoder, ndn_BinaryXML_DTag_Bloom, 0, &value, &valueLen))
+        return error;
+    
+      // Add the any entry.
+      if (exclude->nEntries >= exclude->maxEntries)
+        return NDN_ERROR_read_an_entry_past_the_maximum_number_of_entries_allowed_in_the_exclude;
+      ndn_ExcludeEntry_init(exclude->entries + exclude->nEntries, ndn_Exclude_ANY, 0, 0);
+      ++exclude->nEntries;
+
+      continue;
+    }
+    
+    // Else no more entries.
+    break;
+  }
+  
+  if (error = ndn_BinaryXMLDecoder_readElementClose(decoder))
+    return error;
+  
+  return 0;
+}
+
 ndn_Error ndn_encodeBinaryXMLInterest(struct ndn_Interest *interest, struct ndn_BinaryXMLEncoder *encoder)
 {
   ndn_Error error;
@@ -35,7 +144,9 @@
       return error;
   }
   
-  // TODO: Implement exclude
+  // This will check for no exclude.
+  if (error = encodeExclude(&interest->exclude, encoder))
+    return error;
 
   if (interest->childSelector >= 0) {
     if (error = ndn_BinaryXMLEncoder_writeUnsignedDecimalIntDTagElement
@@ -107,7 +218,14 @@
     interest->publisherPublicKeyDigestLength = 0;
   }
   
-  // TODO: Implement exclude
+  if (error = ndn_BinaryXMLDecoder_peekDTag(decoder, ndn_BinaryXML_DTag_Exclude, &gotExpectedTag))
+    return error;
+  if (gotExpectedTag) {
+    if (error = decodeExclude(&interest->exclude, decoder))
+      return error;
+  }
+  else
+    interest->exclude.nEntries = 0;
   
   if (error = ndn_BinaryXMLDecoder_readOptionalUnsignedIntegerDTagElement
       (decoder, ndn_BinaryXML_DTag_ChildSelector, &interest->childSelector))
