diff --git a/ndn-cpp/c/encoding/BinaryXMLElementReader.c b/ndn-cpp/c/encoding/BinaryXMLElementReader.c
new file mode 100644
index 0000000..9561026
--- /dev/null
+++ b/ndn-cpp/c/encoding/BinaryXMLElementReader.c
@@ -0,0 +1,48 @@
+/**
+ * @author: Jeff Thompson
+ * See COPYING for copyright and distribution information.
+ */
+
+#include "BinaryXMLElementReader.h"
+
+ndn_Error ndn_BinaryXMLElementReader_onReceivedData
+  (struct ndn_BinaryXMLElementReader *self, unsigned char *data, unsigned int dataLength)
+{
+  // Process multiple objects in the data.
+  while(1) {
+    // Scan the input to check if a whole binary XML object has been read.
+    ndn_BinaryXMLStructureDecoder_seek(&self->structureDecoder, 0);
+    
+    ndn_Error error;
+    if (error = ndn_BinaryXMLStructureDecoder_findElementEnd(&self->structureDecoder, data, dataLength))
+      return error;
+    if (self->structureDecoder.gotElementEnd) {
+      // Got the remainder of an element.  Report to the caller.
+#if 0 // TODO: implement saving data parts.
+      this.dataParts.push(data.subarray(0, this.structureDecoder.offset));
+      var element = DataUtils.concatArrays(this.dataParts);
+      this.dataParts = [];
+#endif
+      (*self->elementListener->onReceivedElement)(self->elementListener, data, self->structureDecoder.offset);
+        
+      // Need to read a new object.
+      data += self->structureDecoder.offset;
+      dataLength -= self->structureDecoder.offset;
+      ndn_BinaryXMLStructureDecoder_init(&self->structureDecoder);
+      if (dataLength == 0)
+        // No more data in the packet.
+        return 0;
+            
+      // else loop back to decode.
+    }
+    else {
+#if 0 // TODO: implement saving data parts.
+      // Save for a later call to concatArrays so that we only copy data once.
+      this.dataParts.push(data);
+#else
+      return -1; // TODO: implement saving data parts.
+#endif
+      return 0;
+    }
+  }      
+}
\ No newline at end of file
diff --git a/ndn-cpp/c/encoding/BinaryXMLElementReader.h b/ndn-cpp/c/encoding/BinaryXMLElementReader.h
new file mode 100644
index 0000000..09aeb03
--- /dev/null
+++ b/ndn-cpp/c/encoding/BinaryXMLElementReader.h
@@ -0,0 +1,73 @@
+/**
+ * @author: Jeff Thompson
+ * See COPYING for copyright and distribution information.
+ */
+
+#ifndef NDN_BINARYXMLELEMENTREADER_H
+#define	NDN_BINARYXMLELEMENTREADER_H
+
+#include "../errors.h"
+#include "BinaryXMLStructureDecoder.h"
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+/** An ndn_ElementListener struct holds a function pointer onReceivedElement.  You can extend this struct with data that
+ * will be passed to onReceivedElement.
+ */
+struct ndn_ElementListener {
+  void (*onReceivedElement)(struct ndn_ElementListener *self, unsigned char *element, unsigned int elementLength); /**< see ndn_ElementListener_init */
+};
+
+/**
+ * Initialize an ndn_ElementListener struct to use the onReceivedElement function pointer.
+ * @param self pointer to the ndn_ElementListener struct
+ * @param onReceivedElement pointer to a function which is called when an entire binary XML element is received.
+ * self is the pointer to this ndn_ElementListener struct.  See ndn_BinaryXMLElementReader_onReceivedData.
+ */
+static inline void ndn_ElementListener_init
+  (struct ndn_ElementListener *self, void (*onReceivedElement)(struct ndn_ElementListener *self, unsigned char *element, unsigned int elementLength))
+{
+  self->onReceivedElement = onReceivedElement;
+}
+  
+/**
+ * A BinaryXmlElementReader lets you call ndn_BinaryXMLElementReader_onReceivedData multiple times which uses an
+ * ndn_BinaryXMLStructureDecoder to detect the end of a binary XML element and calls
+ * (*elementListener->onReceivedElement)(element, elementLength) with the element. 
+ * This handles the case where a single call to onReceivedData may contain multiple elements.
+ */
+struct ndn_BinaryXMLElementReader {
+  struct ndn_ElementListener *elementListener;
+  struct ndn_BinaryXMLStructureDecoder structureDecoder;
+};
+
+/**
+ * Initialize an ndn_BinaryXMLElementReader struct with the elementListener.
+ * @param self pointer to the ndn_BinaryXMLElementReader struct
+ * @param elementListener pointer to the ndn_ElementListener used by ndn_BinaryXMLElementReader_onReceivedData.
+ */
+static inline void ndn_BinaryXMLElementReader_init
+  (struct ndn_BinaryXMLElementReader *self, struct ndn_ElementListener *elementListener)
+{
+  self->elementListener = elementListener;
+  ndn_BinaryXMLStructureDecoder_init(&self->structureDecoder);
+}
+
+/**
+ * Continue to read binary XML data until the end of an element, then call (*elementListener->onReceivedElement)(element, elementLength).
+ * The buffer passed to onReceivedElement is only valid during this call.  If you need the data later, you must copy.
+ * @param self pointer to the ndn_BinaryXMLElementReader struct
+ * @param data pointer to the buffer with the binary XML bytes
+ * @param dataLength length of data
+ * @return 0 for success, else an error code
+ */
+ndn_Error ndn_BinaryXMLElementReader_onReceivedData
+  (struct ndn_BinaryXMLElementReader *self, unsigned char *data, unsigned int dataLength);
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif
