diff --git a/ndn-cpp/c/encoding/binary-xml-data.c b/ndn-cpp/c/encoding/binary-xml-data.c
index 25cf16a..0f28ff5 100644
--- a/ndn-cpp/c/encoding/binary-xml-data.c
+++ b/ndn-cpp/c/encoding/binary-xml-data.c
@@ -19,13 +19,11 @@
   
   // TODO: Check if digestAlgorithm is the same as the default, and skip it, otherwise encode it as UDATA.
 
-  if ((error = ndn_BinaryXmlEncoder_writeOptionalBlobDTagElement
-      (encoder, ndn_BinaryXml_DTag_Witness, signature->witness, signature->witnessLength)))
+  if ((error = ndn_BinaryXmlEncoder_writeOptionalBlobDTagElement(encoder, ndn_BinaryXml_DTag_Witness, &signature->witness)))
     return error;
 
   // Require a signature.
-  if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement
-      (encoder, ndn_BinaryXml_DTag_SignatureBits, signature->signature, signature->signatureLength)))
+  if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement(encoder, ndn_BinaryXml_DTag_SignatureBits, &signature->signature)))
     return error;
   
   if ((error = ndn_BinaryXmlEncoder_writeElementClose(encoder)))
@@ -40,15 +38,15 @@
   if ((error = ndn_BinaryXmlDecoder_readElementStartDTag(decoder, ndn_BinaryXml_DTag_Signature)))
     return error;
   
-  /* TODO: digestAlgorithm as UDATA */ signature->digestAlgorithm = 0; signature->digestAlgorithmLength = 0;
+  /* TODO: digestAlgorithm as UDATA */ signature->digestAlgorithm.value = 0; signature->digestAlgorithm.length = 0;
   
   if ((error = ndn_BinaryXmlDecoder_readOptionalBinaryDTagElement
-      (decoder, ndn_BinaryXml_DTag_Witness, 0, &signature->witness, &signature->witnessLength)))
+      (decoder, ndn_BinaryXml_DTag_Witness, 0, &signature->witness)))
     return error;
   
   // Require a signature.
   if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement
-      (decoder, ndn_BinaryXml_DTag_SignatureBits, 0, &signature->signature, &signature->signatureLength)))
+      (decoder, ndn_BinaryXml_DTag_SignatureBits, 0, &signature->signature)))
     return error;
   
   if ((error = ndn_BinaryXmlDecoder_readElementClose(decoder)))
@@ -76,23 +74,22 @@
   
   if (!(metaInfo->type < 0 || metaInfo->type == ndn_ContentType_DATA)) {
     // Not the default of DATA, so we need to encode the type.
-    uint8_t *typeBytes;
-    size_t typeBytesLength = 3;
+    struct ndn_Blob typeBytes;
+    typeBytes.length = 3;
     if (metaInfo->type == ndn_ContentType_ENCR)
-      typeBytes = "\x10\xD0\x91";
+      typeBytes.value = "\x10\xD0\x91";
     else if (metaInfo->type == ndn_ContentType_GONE)
-      typeBytes = "\x18\xE3\x44";
+      typeBytes.value = "\x18\xE3\x44";
     else if (metaInfo->type == ndn_ContentType_KEY)
-      typeBytes = "\x28\x46\x3F";
+      typeBytes.value = "\x28\x46\x3F";
     else if (metaInfo->type == ndn_ContentType_LINK)
-      typeBytes = "\x2C\x83\x4A";
+      typeBytes.value = "\x2C\x83\x4A";
     else if (metaInfo->type == ndn_ContentType_NACK)
-      typeBytes = "\x34\x00\x8A";
+      typeBytes.value = "\x34\x00\x8A";
     else
       return NDN_ERROR_unrecognized_ndn_ContentType;
 
-    if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement
-        (encoder, ndn_BinaryXml_DTag_Type, typeBytes, typeBytesLength)))
+    if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement(encoder, ndn_BinaryXml_DTag_Type, &typeBytes)))
       return error;
   }
   
@@ -101,7 +98,7 @@
     return error;
   
   if ((error = ndn_BinaryXmlEncoder_writeOptionalBlobDTagElement
-      (encoder, ndn_BinaryXml_DTag_FinalBlockID, metaInfo->finalBlockID.value, metaInfo->finalBlockID.valueLength)))
+      (encoder, ndn_BinaryXml_DTag_FinalBlockID, &metaInfo->finalBlockID.value)))
     return error;
  
   // This will skip encoding if there is no key locator.
@@ -127,27 +124,26 @@
       (decoder, ndn_BinaryXml_DTag_Timestamp, &metaInfo->timestampMilliseconds))
     return error;
   
-  uint8_t *typeBytes;
-  size_t typeBytesLength;
+  struct ndn_Blob typeBytes;
   if ((error = ndn_BinaryXmlDecoder_readOptionalBinaryDTagElement
-      (decoder, ndn_BinaryXml_DTag_Type, 0, &typeBytes, &typeBytesLength)))
+      (decoder, ndn_BinaryXml_DTag_Type, 0, &typeBytes)))
     return error;
-  if (typeBytesLength == 0)
+  if (typeBytes.length == 0)
     // The default Type is DATA.
     metaInfo->type = ndn_ContentType_DATA;
-  else if (typeBytesLength == 3) {
+  else if (typeBytes.length == 3) {
     // All the recognized content types are 3 bytes.
-    if (ndn_memcmp(typeBytes, "\x0C\x04\xC0", typeBytesLength) == 0)
+    if (ndn_memcmp(typeBytes.value, "\x0C\x04\xC0", typeBytes.length) == 0)
       metaInfo->type = ndn_ContentType_DATA;
-    else if (ndn_memcmp(typeBytes, "\x10\xD0\x91", typeBytesLength) == 0)
+    else if (ndn_memcmp(typeBytes.value, "\x10\xD0\x91", typeBytes.length) == 0)
       metaInfo->type = ndn_ContentType_ENCR;
-    else if (ndn_memcmp(typeBytes, "\x18\xE3\x44", typeBytesLength) == 0)
+    else if (ndn_memcmp(typeBytes.value, "\x18\xE3\x44", typeBytes.length) == 0)
       metaInfo->type = ndn_ContentType_GONE;
-    else if (ndn_memcmp(typeBytes, "\x28\x46\x3F", typeBytesLength) == 0)
+    else if (ndn_memcmp(typeBytes.value, "\x28\x46\x3F", typeBytes.length) == 0)
       metaInfo->type = ndn_ContentType_KEY;
-    else if (ndn_memcmp(typeBytes, "\x2C\x83\x4A", typeBytesLength) == 0)
+    else if (ndn_memcmp(typeBytes.value, "\x2C\x83\x4A", typeBytes.length) == 0)
       metaInfo->type = ndn_ContentType_LINK;
-    else if (ndn_memcmp(typeBytes, "\x34\x00\x8A", typeBytesLength) == 0)
+    else if (ndn_memcmp(typeBytes.value, "\x34\x00\x8A", typeBytes.length) == 0)
       metaInfo->type = ndn_ContentType_NACK;
     else
       return NDN_ERROR_unrecognized_ndn_ContentType;
@@ -160,7 +156,7 @@
     return error;
 
   if ((error = ndn_BinaryXmlDecoder_readOptionalBinaryDTagElement
-      (decoder, ndn_BinaryXml_DTag_FinalBlockID, 0, &metaInfo->finalBlockID.value, &metaInfo->finalBlockID.valueLength)))
+      (decoder, ndn_BinaryXml_DTag_FinalBlockID, 0, &metaInfo->finalBlockID.value)))
     return error;
 
   if ((error = ndn_decodeOptionalBinaryXmlKeyLocator(&signature->keyLocator, decoder)))
@@ -190,8 +186,7 @@
   if ((error = encodeSignedInfo(&data->signature, &data->metaInfo, encoder)))
     return error;
 
-  if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement
-      (encoder, ndn_BinaryXml_DTag_Content, data->content, data->contentLength)))
+  if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement(encoder, ndn_BinaryXml_DTag_Content, &data->content)))
     return error;
 
   *signedPortionEndOffset = encoder->offset;
@@ -234,8 +229,7 @@
     ndn_MetaInfo_initialize(&data->metaInfo);
 
   // Require a Content element, but set allowNull to allow a missing BLOB.
-  if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement
-      (decoder, ndn_BinaryXml_DTag_Content, 1, &data->content, &data->contentLength)))
+  if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(decoder, ndn_BinaryXml_DTag_Content, 1, &data->content)))
     return error; 
   
   *signedPortionEndOffset = decoder->offset;
diff --git a/ndn-cpp/c/encoding/binary-xml-decoder.c b/ndn-cpp/c/encoding/binary-xml-decoder.c
index 6cbb8ac..eab5cdf 100644
--- a/ndn-cpp/c/encoding/binary-xml-decoder.c
+++ b/ndn-cpp/c/encoding/binary-xml-decoder.c
@@ -140,7 +140,7 @@
 }
 
 ndn_Error ndn_BinaryXmlDecoder_readBinaryDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, uint8_t **value, size_t *valueLength)
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, struct ndn_Blob *value)
 {
   ndn_Error error;
   if ((error = ndn_BinaryXmlDecoder_readElementStartDTag(self, expectedTag)))
@@ -153,8 +153,8 @@
     if (unsafeGetOctet(self) == ndn_BinaryXml_CLOSE) {
       // The binary item is missing, and this is allowed, so read the element close and return a null value.
       ++self->offset;
-      *value = 0;
-      *valueLength = 0;
+      value->value = 0;
+      value->length = 0;
       return NDN_ERROR_success;
     }
   }
@@ -164,9 +164,9 @@
   if ((error = ndn_BinaryXmlDecoder_decodeTypeAndValue(self, &itemType, &uintValueLength)))
     return error;
   // Ignore itemType.
-  *value = self->input + self->offset;
-  *valueLength = (size_t)uintValueLength;
-  self->offset += *valueLength;
+  value->value = self->input + self->offset;
+  value->length = (size_t)uintValueLength;
+  self->offset += value->length;
   
   if ((error = ndn_BinaryXmlDecoder_readElementClose(self)))
     return error;
@@ -175,26 +175,26 @@
 }
 
 ndn_Error ndn_BinaryXmlDecoder_readOptionalBinaryDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, uint8_t **value, size_t *valueLength)
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, struct ndn_Blob *value)
 {
   ndn_Error error;
   int gotExpectedTag;
   if ((error = ndn_BinaryXmlDecoder_peekDTag(self, expectedTag, &gotExpectedTag)))
     return error;
   if (gotExpectedTag) {
-    if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(self, expectedTag, allowNull, value, valueLength)))
+    if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(self, expectedTag, allowNull, value)))
       return error;
   }
   else {
-    *value = 0;
-    *valueLength = 0;
+    value->value = 0;
+    value->length = 0;
   }  
   
   return NDN_ERROR_success;
 }
 
 ndn_Error ndn_BinaryXmlDecoder_readUDataDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, uint8_t **value, size_t *valueLength)
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, struct ndn_Blob *value)
 {
   ndn_Error error;
   if ((error = ndn_BinaryXmlDecoder_readElementStartDTag(self, expectedTag)))
@@ -206,9 +206,9 @@
     return error;
   if (itemType != ndn_BinaryXml_UDATA)
     return NDN_ERROR_item_is_not_UDATA;
-  *value = self->input + self->offset;
-  *valueLength = uintValueLength;
-  self->offset += *valueLength;
+  value->value = self->input + self->offset;
+  value->length = uintValueLength;
+  self->offset += value->length;
   
   if ((error = ndn_BinaryXmlDecoder_readElementClose(self)))
     return error;
@@ -217,19 +217,19 @@
 }
 
 ndn_Error ndn_BinaryXmlDecoder_readOptionalUDataDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, uint8_t **value, size_t *valueLength)
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, struct ndn_Blob *value)
 {
   ndn_Error error;
   int gotExpectedTag;
   if ((error = ndn_BinaryXmlDecoder_peekDTag(self, expectedTag, &gotExpectedTag)))
     return error;
   if (gotExpectedTag) {
-    if ((error = ndn_BinaryXmlDecoder_readUDataDTagElement(self, expectedTag, value, valueLength)))
+    if ((error = ndn_BinaryXmlDecoder_readUDataDTagElement(self, expectedTag, value)))
       return error;
   }
   else {
-    *value = 0;
-    *valueLength = 0;
+    value->value = 0;
+    value->length = 0;
   }  
   
   return NDN_ERROR_success;
@@ -238,13 +238,12 @@
 ndn_Error ndn_BinaryXmlDecoder_readUnsignedIntegerDTagElement
   (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, unsigned int *value)
 {
-  uint8_t *udataValue;
-  size_t udataValueLength;
+  struct ndn_Blob udataValue;
   ndn_Error error;
-  if ((error = ndn_BinaryXmlDecoder_readUDataDTagElement(self, expectedTag, &udataValue, &udataValueLength)))
+  if ((error = ndn_BinaryXmlDecoder_readUDataDTagElement(self, expectedTag, &udataValue)))
     return error;
   
-  if ((error = parseUnsignedDecimalInt(udataValue, udataValueLength, value)))
+  if ((error = parseUnsignedDecimalInt(udataValue.value, udataValue.length, value)))
     return error;
   
   return NDN_ERROR_success;
@@ -275,12 +274,11 @@
   (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, double *milliseconds)
 {
   ndn_Error error;
-  uint8_t *bytes;
-  size_t bytesLength;
-  if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(self, expectedTag, 0, &bytes, &bytesLength)))
+  struct ndn_Blob bytes;
+  if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(self, expectedTag, 0, &bytes)))
     return error;
     
-  *milliseconds = 1000.0 * ndn_BinaryXmlDecoder_unsignedBigEndianToDouble(bytes, bytesLength) / 4096.0;
+  *milliseconds = 1000.0 * ndn_BinaryXmlDecoder_unsignedBigEndianToDouble(bytes.value, bytes.length) / 4096.0;
   return NDN_ERROR_success;  
 }
 
diff --git a/ndn-cpp/c/encoding/binary-xml-decoder.h b/ndn-cpp/c/encoding/binary-xml-decoder.h
index a520a0f..3e16497 100644
--- a/ndn-cpp/c/encoding/binary-xml-decoder.h
+++ b/ndn-cpp/c/encoding/binary-xml-decoder.h
@@ -9,6 +9,7 @@
 
 #include "../common.h"
 #include "../errors.h"
+#include "../util/blob.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -71,14 +72,12 @@
  * @param expectedTag the expected value for DTAG
  * @param allowNull 1 if the binary item may be missing
  * @param value output a pointer to the binary data inside self's input buffer. However, if allowNull is 1 and the
- * binary data item is absent, then return 0.
- * @param valueLength output the length of the binary data. However, if allowNull is 1 and the
- * binary data item is absent, then return 0.
+ * binary data item is absent, then set value and length to 0.
  * @return 0 for success, else an error code, including an error if not the expected tag, or if allowNull is 0
  * and the binary data is absent
  */
 ndn_Error ndn_BinaryXmlDecoder_readBinaryDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, uint8_t **value, size_t *valueLength);
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, struct ndn_Blob *value);
 
 /**
  * Peek at the next element and if it is the expectedTag, call ndn_BinaryXmlDecoder_readBinaryDTagElement.
@@ -87,13 +86,11 @@
  * @param expectedTag the expected value for DTAG
  * @param allowNull 1 if the binary item may be missing
  * @param value output a pointer to the binary data inside self's input buffer. However, if allowNull is 1 and the
- * binary data item is absent, then return 0.
- * @param valueLength output the length of the binary data. However, if allowNull is 1 and the
- * binary data item is absent, then return 0.
+ * binary data item is absent, then set value and length to 0.
  * @return 0 for success, else an error code, including if allowNull is 0 and the binary data is absent
  */
 ndn_Error ndn_BinaryXmlDecoder_readOptionalBinaryDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, uint8_t **value, size_t *valueLength);
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, struct ndn_Blob *value);
 
 /**
  * Decode the header from self's input starting at offset, expecting the type to be DTAG and the value to be expectedTag.
@@ -102,11 +99,10 @@
  * @param self pointer to the ndn_BinaryXmlDecoder struct
  * @param expectedTag the expected value for DTAG
  * @param value output a pointer to the binary data inside self's input buffer.
- * @param valueLength output the length of the binary data.
  * @return 0 for success, else an error code, including an error if not the expected tag, or if the item is not UDATA.
  */
 ndn_Error ndn_BinaryXmlDecoder_readUDataDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, uint8_t **value, size_t *valueLength);
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, struct ndn_Blob *value);
 
 /**
  * Peek at the next element and if it is the expectedTag, call ndn_BinaryXmlDecoder_readUDataDTagElement.
@@ -114,13 +110,11 @@
  * @param self pointer to the ndn_BinaryXmlDecoder struct
  * @param expectedTag the expected value for DTAG
  * @param value output a pointer to the binary data inside self's input buffer. However, if allowNull is 1 and the
- * binary data item is absent, then return 0.
- * @param valueLength output the length of the binary data. However, if allowNull is 1 and the
- * binary data item is absent, then return 0.
+ * binary data item is absent, then set value and length to 0.
  * @return 0 for success, else an error code.
  */
 ndn_Error ndn_BinaryXmlDecoder_readOptionalUDataDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, uint8_t **value, size_t *valueLength);
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, struct ndn_Blob *value);
 
 /**
  * Decode the header from self's input starting at offset, expecting the type to be DTAG and the value to be expectedTag.
diff --git a/ndn-cpp/c/encoding/binary-xml-encoder.c b/ndn-cpp/c/encoding/binary-xml-encoder.c
index 652de3e..10f6cd6 100644
--- a/ndn-cpp/c/encoding/binary-xml-encoder.c
+++ b/ndn-cpp/c/encoding/binary-xml-encoder.c
@@ -217,25 +217,25 @@
   return NDN_ERROR_success;
 }
 
-ndn_Error ndn_BinaryXmlEncoder_writeBlob(struct ndn_BinaryXmlEncoder *self, uint8_t *value, size_t valueLength)
+ndn_Error ndn_BinaryXmlEncoder_writeBlob(struct ndn_BinaryXmlEncoder *self, struct ndn_Blob *value)
 {
   ndn_Error error;
-  if ((error = ndn_BinaryXmlEncoder_encodeTypeAndValue(self, ndn_BinaryXml_BLOB, valueLength)))
+  if ((error = ndn_BinaryXmlEncoder_encodeTypeAndValue(self, ndn_BinaryXml_BLOB, value->length)))
     return error;
   
-  if ((error = writeArray(self, value, valueLength)))
+  if ((error = writeArray(self, value->value, value->length)))
     return error;
   
   return NDN_ERROR_success;
 }
 
-ndn_Error ndn_BinaryXmlEncoder_writeBlobDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, size_t valueLength)
+ndn_Error ndn_BinaryXmlEncoder_writeBlobDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, struct ndn_Blob *value)
 {
   ndn_Error error;
   if ((error = ndn_BinaryXmlEncoder_writeElementStartDTag(self, tag)))
     return error;
   
-  if ((error = ndn_BinaryXmlEncoder_writeBlob(self, value, valueLength)))
+  if ((error = ndn_BinaryXmlEncoder_writeBlob(self, value)))
     return error;  
   
   if ((error = ndn_BinaryXmlEncoder_writeElementClose(self)))
@@ -244,25 +244,25 @@
   return NDN_ERROR_success;
 }
 
-ndn_Error ndn_BinaryXmlEncoder_writeUData(struct ndn_BinaryXmlEncoder *self, uint8_t *value, size_t valueLength)
+ndn_Error ndn_BinaryXmlEncoder_writeUData(struct ndn_BinaryXmlEncoder *self, struct ndn_Blob *value)
 {
   ndn_Error error;
-  if ((error = ndn_BinaryXmlEncoder_encodeTypeAndValue(self, ndn_BinaryXml_UDATA, valueLength)))
+  if ((error = ndn_BinaryXmlEncoder_encodeTypeAndValue(self, ndn_BinaryXml_UDATA, value->length)))
     return error;
   
-  if ((error = writeArray(self, value, valueLength)))
+  if ((error = writeArray(self, value->value, value->length)))
     return error;
   
   return NDN_ERROR_success;
 }
 
-ndn_Error ndn_BinaryXmlEncoder_writeUDataDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, size_t valueLength)
+ndn_Error ndn_BinaryXmlEncoder_writeUDataDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, struct ndn_Blob *value)
 {
   ndn_Error error;
   if ((error = ndn_BinaryXmlEncoder_writeElementStartDTag(self, tag)))
     return error;
   
-  if ((error = ndn_BinaryXmlEncoder_writeUData(self, value, valueLength)))
+  if ((error = ndn_BinaryXmlEncoder_writeUData(self, value)))
     return error;  
   
   if ((error = ndn_BinaryXmlEncoder_writeElementClose(self)))
diff --git a/ndn-cpp/c/encoding/binary-xml-encoder.h b/ndn-cpp/c/encoding/binary-xml-encoder.h
index c457185..81fa6b9 100644
--- a/ndn-cpp/c/encoding/binary-xml-encoder.h
+++ b/ndn-cpp/c/encoding/binary-xml-encoder.h
@@ -9,6 +9,7 @@
 
 #include "../errors.h"
 #include "../util/dynamic-uint8-array.h"
+#include "../util/blob.h"
 #include "binary-xml.h"
 
 #ifdef __cplusplus
@@ -66,36 +67,33 @@
 /**
  * Write a BLOB header, then the bytes of the blob value to self->output.
  * @param self pointer to the ndn_BinaryXmlEncoder struct
- * @param value an array of bytes for the blob value
- * @param valueLength the length of the array
+ * @param value A Blob with the array of bytes for the value.
  * @return 0 for success, else an error code
  */
-ndn_Error ndn_BinaryXmlEncoder_writeBlob(struct ndn_BinaryXmlEncoder *self, uint8_t *value, size_t valueLength);
+ndn_Error ndn_BinaryXmlEncoder_writeBlob(struct ndn_BinaryXmlEncoder *self, struct ndn_Blob *value);
 
 /**
  * Write an element start header using DTAG with the tag to self->output, then the blob, then an element close.
  * (If you want to just write the blob, use ndn_BinaryXmlEncoder_writeBlob .)
  * @param self pointer to the ndn_BinaryXmlEncoder struct
  * @param tag the DTAG tag
- * @param value an array of bytes for the blob value
- * @param valueLength the length of the array
+ * @param value A Blob with the array of bytes for the value.
  * @return 0 for success, else an error code
  */
-ndn_Error ndn_BinaryXmlEncoder_writeBlobDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, size_t valueLength);
+ndn_Error ndn_BinaryXmlEncoder_writeBlobDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, struct ndn_Blob *value);
 
 /**
  * If value or valueLen is 0 then do nothing, otherwise call ndn_BinaryXmlEncoder_writeBlobDTagElement.
- * @param self pointer to the ndn_BinaryXmlEncoder struct
- * @param tag the DTAG tag
- * @param value an array of bytes for the blob value
- * @param valueLength the length of the array
+ * @param self A pointer to the ndn_BinaryXmlEncoder struct.
+ * @param tag The DTAG tag.
+ * @param value A Blob with the array of bytes for the value.
  * @return 0 for success, else an error code
  */
 static inline ndn_Error ndn_BinaryXmlEncoder_writeOptionalBlobDTagElement
-  (struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, size_t valueLength)
+  (struct ndn_BinaryXmlEncoder *self, unsigned int tag, struct ndn_Blob *value)
 {
-  if (value && valueLength > 0)
-    return ndn_BinaryXmlEncoder_writeBlobDTagElement(self, tag, value, valueLength);
+  if (value->value && value->length > 0)
+    return ndn_BinaryXmlEncoder_writeBlobDTagElement(self, tag, value);
   else
     return NDN_ERROR_success;
 }
@@ -103,36 +101,33 @@
 /**
  * Write a UDATA header, then the bytes of the UDATA value to self->output.
  * @param self pointer to the ndn_BinaryXmlEncoder struct
- * @param value an array of bytes for the value
- * @param valueLength the length of the array
+ * @param value A Blob with the array of bytes for the value.
  * @return 0 for success, else an error code
  */
-ndn_Error ndn_BinaryXmlEncoder_writeUData(struct ndn_BinaryXmlEncoder *self, uint8_t *value, size_t valueLength);
+ndn_Error ndn_BinaryXmlEncoder_writeUData(struct ndn_BinaryXmlEncoder *self, struct ndn_Blob *value);
 
 /**
  * Write an element start header using DTAG with the tag to self->output, then the UDATA value, then an element close.
  * (If you want to just write the UDATA value, use ndn_BinaryXmlEncoder_writeUData .)
  * @param self pointer to the ndn_BinaryXmlEncoder struct
  * @param tag the DTAG tag
- * @param value an array of bytes for the value
- * @param valueLength the length of the array
+ * @param value A Blob with the array of bytes for the value.
  * @return 0 for success, else an error code
  */
-ndn_Error ndn_BinaryXmlEncoder_writeUDataDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, size_t valueLength);
+ndn_Error ndn_BinaryXmlEncoder_writeUDataDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, struct ndn_Blob *value);
 
 /**
  * If value or valueLen is 0 then do nothing, otherwise call ndn_BinaryXmlEncoder_writeUDataDTagElement.
  * @param self pointer to the ndn_BinaryXmlEncoder struct
  * @param tag the DTAG tag
- * @param value an array of bytes for the value
- * @param valueLength the length of the array
+ * @param value A Blob with the array of bytes for the value.
  * @return 0 for success, else an error code
  */
 static inline ndn_Error ndn_BinaryXmlEncoder_writeOptionalUDataDTagElement
-  (struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, size_t valueLength)
+  (struct ndn_BinaryXmlEncoder *self, unsigned int tag, struct ndn_Blob *value)
 {
-  if (value && valueLength > 0)
-    return ndn_BinaryXmlEncoder_writeUDataDTagElement(self, tag, value, valueLength);
+  if (value->value && value->length > 0)
+    return ndn_BinaryXmlEncoder_writeUDataDTagElement(self, tag, value);
   else
     return NDN_ERROR_success;
 }
diff --git a/ndn-cpp/c/encoding/binary-xml-forwarding-entry.c b/ndn-cpp/c/encoding/binary-xml-forwarding-entry.c
index 8788cec..271029b 100644
--- a/ndn-cpp/c/encoding/binary-xml-forwarding-entry.c
+++ b/ndn-cpp/c/encoding/binary-xml-forwarding-entry.c
@@ -15,7 +15,7 @@
     return error;
     
   if ((error = ndn_BinaryXmlEncoder_writeOptionalUDataDTagElement
-      (encoder, ndn_BinaryXml_DTag_Action, forwardingEntry->action, forwardingEntry->actionLength)))
+      (encoder, ndn_BinaryXml_DTag_Action, &forwardingEntry->action)))
     return error;
   if ((error = ndn_encodeBinaryXmlName(&forwardingEntry->prefix, encoder)))
     return error;
@@ -46,7 +46,7 @@
     return error;
     
   if ((error = ndn_BinaryXmlDecoder_readOptionalUDataDTagElement
-      (decoder, ndn_BinaryXml_DTag_Action, &forwardingEntry->action, &forwardingEntry->actionLength)))
+      (decoder, ndn_BinaryXml_DTag_Action, &forwardingEntry->action)))
     return error;
   if ((error = ndn_decodeBinaryXmlName(&forwardingEntry->prefix, decoder)))
     return error;
diff --git a/ndn-cpp/c/encoding/binary-xml-interest.c b/ndn-cpp/c/encoding/binary-xml-interest.c
index a43ce3b..48d3fe0 100644
--- a/ndn-cpp/c/encoding/binary-xml-interest.c
+++ b/ndn-cpp/c/encoding/binary-xml-interest.c
@@ -26,8 +26,7 @@
     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.value, entry->component.valueLength)))
+      if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement(encoder, ndn_BinaryXml_DTag_Component, &entry->component.value)))
         return error;
     }
     else if (entry->type == ndn_Exclude_ANY) {
@@ -60,15 +59,14 @@
       return error;    
     if (gotExpectedTag) {
       // Component
-      uint8_t *component;
-      size_t componentLen;
-      if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(decoder, ndn_BinaryXml_DTag_Component, 0, &component, &componentLen)))
+      struct ndn_Blob component;
+      if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(decoder, ndn_BinaryXml_DTag_Component, 0, &component)))
         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_initialize(exclude->entries + exclude->nEntries, ndn_Exclude_COMPONENT, component, componentLen);
+      ndn_ExcludeEntry_initialize(exclude->entries + exclude->nEntries, ndn_Exclude_COMPONENT, component.value, component.length);
       ++exclude->nEntries;
 
       continue;
@@ -96,9 +94,8 @@
       return error;    
     if (gotExpectedTag) {
       // Skip the Bloom and treat it as Any.
-      uint8_t *value;
-      size_t valueLen;
-      if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(decoder, ndn_BinaryXml_DTag_Bloom, 0, &value, &valueLen)))
+      struct ndn_Blob value;
+      if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(decoder, ndn_BinaryXml_DTag_Bloom, 0, &value)))
         return error;
     
       // Add the any entry.
@@ -160,8 +157,7 @@
       (encoder, ndn_BinaryXml_DTag_InterestLifetime, interest->interestLifetimeMilliseconds)))
     return error;
   
-  if ((error = ndn_BinaryXmlEncoder_writeOptionalBlobDTagElement
-      (encoder, ndn_BinaryXml_DTag_Nonce, interest->nonce, interest->nonceLength)))
+  if ((error = ndn_BinaryXmlEncoder_writeOptionalBlobDTagElement(encoder, ndn_BinaryXml_DTag_Nonce, &interest->nonce)))
     return error;
   
   if ((error = ndn_BinaryXmlEncoder_writeElementClose(encoder)))
@@ -214,7 +210,7 @@
     return error;
   
   if ((error = ndn_BinaryXmlDecoder_readOptionalBinaryDTagElement
-      (decoder, ndn_BinaryXml_DTag_Nonce, 0, &interest->nonce, &interest->nonceLength)))
+      (decoder, ndn_BinaryXml_DTag_Nonce, 0, &interest->nonce)))
     return error;
 
   if ((error = ndn_BinaryXmlDecoder_readElementClose(decoder)))
diff --git a/ndn-cpp/c/encoding/binary-xml-key.c b/ndn-cpp/c/encoding/binary-xml-key.c
index 5ae3db0..d9cce61 100644
--- a/ndn-cpp/c/encoding/binary-xml-key.c
+++ b/ndn-cpp/c/encoding/binary-xml-key.c
@@ -18,7 +18,7 @@
   if (gotExpectedTag) {
     keyLocator->keyNameType = ndn_KeyNameType_PUBLISHER_PUBLIC_KEY_DIGEST;
     if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement
-        (decoder, ndn_BinaryXml_DTag_PublisherPublicKeyDigest, 0, &keyLocator->keyData, &keyLocator->keyDataLength)))
+        (decoder, ndn_BinaryXml_DTag_PublisherPublicKeyDigest, 0, &keyLocator->keyData)))
       return error;
   }
   else {
@@ -27,7 +27,7 @@
     if (gotExpectedTag) {
       keyLocator->keyNameType = ndn_KeyNameType_PUBLISHER_CERTIFICATE_DIGEST;
       if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement
-          (decoder, ndn_BinaryXml_DTag_PublisherCertificateDigest, 0, &keyLocator->keyData, &keyLocator->keyDataLength)))
+          (decoder, ndn_BinaryXml_DTag_PublisherCertificateDigest, 0, &keyLocator->keyData)))
         return error;
     }
     else {
@@ -36,7 +36,7 @@
       if (gotExpectedTag) {
         keyLocator->keyNameType = ndn_KeyNameType_PUBLISHER_ISSUER_KEY_DIGEST;
         if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement
-            (decoder, ndn_BinaryXml_DTag_PublisherIssuerKeyDigest, 0, &keyLocator->keyData, &keyLocator->keyDataLength)))
+            (decoder, ndn_BinaryXml_DTag_PublisherIssuerKeyDigest, 0, &keyLocator->keyData)))
           return error;
       }
       else {
@@ -45,13 +45,13 @@
         if (gotExpectedTag) {
           keyLocator->keyNameType = ndn_KeyNameType_PUBLISHER_ISSUER_CERTIFICATE_DIGEST;
           if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement
-              (decoder, ndn_BinaryXml_DTag_PublisherIssuerCertificateDigest, 0, &keyLocator->keyData, &keyLocator->keyDataLength)))
+              (decoder, ndn_BinaryXml_DTag_PublisherIssuerCertificateDigest, 0, &keyLocator->keyData)))
             return error;
         }
         else {
           // Key name data is omitted.
           keyLocator->keyNameType = -1;
-          keyLocator->keyDataLength = 0;
+          keyLocator->keyData.length = 0;
         }
       }
     }
@@ -70,13 +70,11 @@
     return error;
 
   if (keyLocator->type == ndn_KeyLocatorType_KEY) {
-    if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement
-        (encoder, ndn_BinaryXml_DTag_Key, keyLocator->keyData, keyLocator->keyDataLength)))
+    if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement(encoder, ndn_BinaryXml_DTag_Key, &keyLocator->keyData)))
       return error;    
   }
   else if (keyLocator->type == ndn_KeyLocatorType_CERTIFICATE) {
-    if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement
-        (encoder, ndn_BinaryXml_DTag_Certificate, keyLocator->keyData, keyLocator->keyDataLength)))
+    if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement(encoder, ndn_BinaryXml_DTag_Certificate, &keyLocator->keyData)))
       return error;    
   }
   else if (keyLocator->type == ndn_KeyLocatorType_KEYNAME) {
@@ -85,25 +83,25 @@
     if ((error = ndn_encodeBinaryXmlName(&keyLocator->keyName, encoder)))
       return error;
     
-    if ((int)keyLocator->keyNameType >= 0 && keyLocator->keyDataLength > 0) {
+    if ((int)keyLocator->keyNameType >= 0 && keyLocator->keyData.length > 0) {
       if (keyLocator->keyNameType == ndn_KeyNameType_PUBLISHER_PUBLIC_KEY_DIGEST) {
         if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement
-            (encoder, ndn_BinaryXml_DTag_PublisherPublicKeyDigest, keyLocator->keyData, keyLocator->keyDataLength)))
+            (encoder, ndn_BinaryXml_DTag_PublisherPublicKeyDigest, &keyLocator->keyData)))
           return error;    
       }
       else if (keyLocator->keyNameType == ndn_KeyNameType_PUBLISHER_CERTIFICATE_DIGEST) {
         if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement
-            (encoder, ndn_BinaryXml_DTag_PublisherCertificateDigest, keyLocator->keyData, keyLocator->keyDataLength)))
+            (encoder, ndn_BinaryXml_DTag_PublisherCertificateDigest, &keyLocator->keyData)))
           return error;    
       }
       else if (keyLocator->keyNameType == ndn_KeyNameType_PUBLISHER_ISSUER_KEY_DIGEST) {
         if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement
-            (encoder, ndn_BinaryXml_DTag_PublisherIssuerKeyDigest, keyLocator->keyData, keyLocator->keyDataLength)))
+            (encoder, ndn_BinaryXml_DTag_PublisherIssuerKeyDigest, &keyLocator->keyData)))
           return error;    
       }
       else if (keyLocator->keyNameType == ndn_KeyNameType_PUBLISHER_ISSUER_CERTIFICATE_DIGEST) {
         if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement
-            (encoder, ndn_BinaryXml_DTag_PublisherIssuerCertificateDigest, keyLocator->keyData, keyLocator->keyDataLength)))
+            (encoder, ndn_BinaryXml_DTag_PublisherIssuerCertificateDigest, &keyLocator->keyData)))
           return error;    
       }
       else
@@ -134,8 +132,7 @@
   if (gotExpectedTag) {
     keyLocator->type = ndn_KeyLocatorType_KEY;
     
-    if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement
-        (decoder, ndn_BinaryXml_DTag_Key, 0, &keyLocator->keyData, &keyLocator->keyDataLength)))
+    if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(decoder, ndn_BinaryXml_DTag_Key, 0, &keyLocator->keyData)))
       return error;
   }
   else {
@@ -145,7 +142,7 @@
       keyLocator->type = ndn_KeyLocatorType_CERTIFICATE;
     
       if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement
-          (decoder, ndn_BinaryXml_DTag_Certificate, 0, &keyLocator->keyData, &keyLocator->keyDataLength)))
+          (decoder, ndn_BinaryXml_DTag_Certificate, 0, &keyLocator->keyData)))
         return error;
     }
     else {
diff --git a/ndn-cpp/c/encoding/binary-xml-name.c b/ndn-cpp/c/encoding/binary-xml-name.c
index 00f5858..30cd60f 100644
--- a/ndn-cpp/c/encoding/binary-xml-name.c
+++ b/ndn-cpp/c/encoding/binary-xml-name.c
@@ -17,8 +17,7 @@
   
   size_t i;
   for (i = 0; i < name->nComponents; ++i) {
-    if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement
-        (encoder, ndn_BinaryXml_DTag_Component, name->components[i].value, name->components[i].valueLength)))
+    if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement(encoder, ndn_BinaryXml_DTag_Component, &name->components[i].value)))
       return error;
   }
   
@@ -44,15 +43,14 @@
       // No more components.
       break;
     
-    uint8_t *component;
-    size_t componentLen;
-    if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(decoder, ndn_BinaryXml_DTag_Component, 0, &component, &componentLen)))
+    struct ndn_Blob component;
+    if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(decoder, ndn_BinaryXml_DTag_Component, 0, &component)))
       return error;
     
     // Add the component to the name.
     if (name->nComponents >= name->maxComponents)
       return NDN_ERROR_read_a_component_past_the_maximum_number_of_components_allowed_in_the_name;
-    ndn_NameComponent_initialize(name->components + name->nComponents, component, componentLen);
+    ndn_NameComponent_initialize(name->components + name->nComponents, component.value, component.length);
     ++name->nComponents;
   }
   
diff --git a/ndn-cpp/c/encoding/binary-xml-publisher-public-key-digest.c b/ndn-cpp/c/encoding/binary-xml-publisher-public-key-digest.c
index 37015bc..4748147 100644
--- a/ndn-cpp/c/encoding/binary-xml-publisher-public-key-digest.c
+++ b/ndn-cpp/c/encoding/binary-xml-publisher-public-key-digest.c
@@ -11,13 +11,12 @@
 ndn_Error ndn_encodeBinaryXmlPublisherPublicKeyDigest
   (struct ndn_PublisherPublicKeyDigest *publisherPublicKeyDigest, struct ndn_BinaryXmlEncoder *encoder)
 {  
-  if (!publisherPublicKeyDigest->publisherPublicKeyDigest || publisherPublicKeyDigest->publisherPublicKeyDigestLength == 0)
+  if (!publisherPublicKeyDigest->publisherPublicKeyDigest.value || publisherPublicKeyDigest->publisherPublicKeyDigest.length == 0)
     return NDN_ERROR_success;
   
   ndn_Error error;
   if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement
-      (encoder, ndn_BinaryXml_DTag_PublisherPublicKeyDigest, publisherPublicKeyDigest->publisherPublicKeyDigest, 
-       publisherPublicKeyDigest->publisherPublicKeyDigestLength)))
+      (encoder, ndn_BinaryXml_DTag_PublisherPublicKeyDigest, &publisherPublicKeyDigest->publisherPublicKeyDigest)))
     return error;
   
   return NDN_ERROR_success;
@@ -28,8 +27,7 @@
 {
   ndn_Error error; 
   if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement
-      (decoder, ndn_BinaryXml_DTag_PublisherPublicKeyDigest, 0, &publisherPublicKeyDigest->publisherPublicKeyDigest,
-       &publisherPublicKeyDigest->publisherPublicKeyDigestLength)))
+      (decoder, ndn_BinaryXml_DTag_PublisherPublicKeyDigest, 0, &publisherPublicKeyDigest->publisherPublicKeyDigest)))
     return error;
   
   return NDN_ERROR_success;
@@ -47,8 +45,8 @@
       return error;
   }
   else {
-    publisherPublicKeyDigest->publisherPublicKeyDigest = 0;
-    publisherPublicKeyDigest->publisherPublicKeyDigestLength = 0;
+    publisherPublicKeyDigest->publisherPublicKeyDigest.value = 0;
+    publisherPublicKeyDigest->publisherPublicKeyDigest.length = 0;
   }
   
   return NDN_ERROR_success;
