diff --git a/ndn-cpp/c/encoding/BinaryXMLEncoder.c b/ndn-cpp/c/encoding/BinaryXMLEncoder.c
index b7f1db1..0b38f87 100644
--- a/ndn-cpp/c/encoding/BinaryXMLEncoder.c
+++ b/ndn-cpp/c/encoding/BinaryXMLEncoder.c
@@ -10,20 +10,20 @@
 #include "BinaryXMLEncoder.h"
 
 enum {
-  ENCODING_LIMIT_1_BYTE = ((1 << ndn_BinaryXML_TT_VALUE_BITS) - 1),
-  ENCODING_LIMIT_2_BYTES = ((1 << (ndn_BinaryXML_TT_VALUE_BITS + ndn_BinaryXML_REGULAR_VALUE_BITS)) - 1),
-  ENCODING_LIMIT_3_BYTES = ((1 << (ndn_BinaryXML_TT_VALUE_BITS + 2 * ndn_BinaryXML_REGULAR_VALUE_BITS)) - 1)
+  ENCODING_LIMIT_1_BYTE = ((1 << ndn_BinaryXml_TT_VALUE_BITS) - 1),
+  ENCODING_LIMIT_2_BYTES = ((1 << (ndn_BinaryXml_TT_VALUE_BITS + ndn_BinaryXml_REGULAR_VALUE_BITS)) - 1),
+  ENCODING_LIMIT_3_BYTES = ((1 << (ndn_BinaryXml_TT_VALUE_BITS + 2 * ndn_BinaryXml_REGULAR_VALUE_BITS)) - 1)
 };
 
 /**
  * Call ndn_DynamicUCharArray_ensureLength to ensure that there is enough room in the output, and copy
  * array to the output.  This does not write a header.
- * @param self pointer to the ndn_BinaryXMLEncoder struct
+ * @param self pointer to the ndn_BinaryXmlEncoder struct
  * @param array the array to copy
  * @param arrayLength the length of the array
  * @return 0 for success, else an error code
  */
-static ndn_Error writeArray(struct ndn_BinaryXMLEncoder *self, unsigned char *array, unsigned int arrayLength)
+static ndn_Error writeArray(struct ndn_BinaryXmlEncoder *self, unsigned char *array, unsigned int arrayLength)
 {
   ndn_Error error;
   if (error = ndn_DynamicUCharArray_ensureLength(&self->output, self->offset + arrayLength))
@@ -52,10 +52,10 @@
 	
 	// Last byte gives you TT_VALUE_BITS.
 	// Remainder each gives you REGULAR_VALUE_BITS.
-	x >>= ndn_BinaryXML_TT_VALUE_BITS;
+	x >>= ndn_BinaryXml_TT_VALUE_BITS;
 	while (x != 0) {
     ++nBytes;
-	  x >>= ndn_BinaryXML_REGULAR_VALUE_BITS;
+	  x >>= ndn_BinaryXml_REGULAR_VALUE_BITS;
 	}
   
 	return nBytes;
@@ -88,11 +88,11 @@
  * Write x as an unsigned decimal integer to the output with the digits in reverse order, using ndn_DynamicUCharArray_ensureLength.
  * This does not write a header.
  * We encode in reverse order, because this is the natural way to encode the digits, and the caller can reverse as needed.
- * @param self pointer to the ndn_BinaryXMLEncoder struct
+ * @param self pointer to the ndn_BinaryXmlEncoder struct
  * @param x the unsigned int to write
  * @return 0 for success, else an error code
  */
-static ndn_Error encodeReversedUnsignedDecimalInt(struct ndn_BinaryXMLEncoder *self, unsigned int x) 
+static ndn_Error encodeReversedUnsignedDecimalInt(struct ndn_BinaryXmlEncoder *self, unsigned int x) 
 {
   while (1) {
     ndn_Error error;
@@ -114,13 +114,13 @@
  * then encode the header at startOffset.
  * startOffser it the position in self-output.array of the first byte of the buffer and self->offset is the first byte past the end.
  * We reverse and shift in the same function to avoid unnecessary copying if we first reverse then shift.
- * @param self pointer to the ndn_BinaryXMLEncoder struct
+ * @param self pointer to the ndn_BinaryXmlEncoder struct
  * @param startOffset the offset in self->output.array of the start of the buffer to shift right
  * @param type the header type
  * @return 0 for success, else an error code
  */
 static ndn_Error reverseBufferAndInsertHeader
-  (struct ndn_BinaryXMLEncoder *self, unsigned int startOffset, unsigned int type)
+  (struct ndn_BinaryXmlEncoder *self, unsigned int startOffset, unsigned int type)
 {
   unsigned int nBufferBytes = self->offset - startOffset;
   unsigned int nHeaderBytes = getNHeaderEncodingBytes(nBufferBytes);
@@ -141,7 +141,7 @@
   
   // Override the offset to force encodeTypeAndValue to encode at startOffset, then fix the offset.
   self->offset = startOffset;
-  if (error = ndn_BinaryXMLEncoder_encodeTypeAndValue(self, ndn_BinaryXML_UDATA, nBufferBytes))
+  if (error = ndn_BinaryXmlEncoder_encodeTypeAndValue(self, ndn_BinaryXml_UDATA, nBufferBytes))
     // We don't really expect to get an error, since we have already ensured the length.
     return error;
   self->offset = startOffset + nHeaderBytes + nBufferBytes;
@@ -170,9 +170,9 @@
   *hi32 = (unsigned long)((x - lo32Double) / twoPower32);
 }
 
-ndn_Error ndn_BinaryXMLEncoder_encodeTypeAndValue(struct ndn_BinaryXMLEncoder *self, unsigned int type, unsigned int value)
+ndn_Error ndn_BinaryXmlEncoder_encodeTypeAndValue(struct ndn_BinaryXmlEncoder *self, unsigned int type, unsigned int value)
 {
-	if (type > ndn_BinaryXML_UDATA)
+	if (type > ndn_BinaryXml_UDATA)
 		return NDN_ERROR_header_type_is_out_of_range;
   
 	// Encode backwards. Calculate how many bytes we need.
@@ -183,16 +183,16 @@
 
 	// Bottom 4 bits of value go in last byte with tag.
 	self->output.array[self->offset + nEncodingBytes - 1] = 
-		(ndn_BinaryXML_TT_MASK & type | 
-		((ndn_BinaryXML_TT_VALUE_MASK & value) << ndn_BinaryXML_TT_BITS)) |
-		ndn_BinaryXML_TT_FINAL; // set top bit for last byte
-	value >>= ndn_BinaryXML_TT_VALUE_BITS;
+		(ndn_BinaryXml_TT_MASK & type | 
+		((ndn_BinaryXml_TT_VALUE_MASK & value) << ndn_BinaryXml_TT_BITS)) |
+		ndn_BinaryXml_TT_FINAL; // set top bit for last byte
+	value >>= ndn_BinaryXml_TT_VALUE_BITS;
 	
 	// Rest of value goes into preceding bytes, 7 bits per byte. (Zero top bit is "more" flag.)
 	unsigned int i = self->offset + nEncodingBytes - 2;
 	while (value != 0 && i >= self->offset) {
-		self->output.array[i] = (value & ndn_BinaryXML_REGULAR_VALUE_MASK);
-		value >>= ndn_BinaryXML_REGULAR_VALUE_BITS;
+		self->output.array[i] = (value & ndn_BinaryXml_REGULAR_VALUE_MASK);
+		value >>= ndn_BinaryXml_REGULAR_VALUE_BITS;
 		--i;
 	}
 	if (value != 0)
@@ -204,22 +204,22 @@
   return 0;
 }
 
-ndn_Error ndn_BinaryXMLEncoder_writeElementClose(struct ndn_BinaryXMLEncoder *self)
+ndn_Error ndn_BinaryXmlEncoder_writeElementClose(struct ndn_BinaryXmlEncoder *self)
 {
   ndn_Error error;
   if (error = ndn_DynamicUCharArray_ensureLength(&self->output, self->offset + 1))
     return error;
   
-	self->output.array[self->offset] = ndn_BinaryXML_CLOSE;
+	self->output.array[self->offset] = ndn_BinaryXml_CLOSE;
 	self->offset += 1;
   
   return 0;
 }
 
-ndn_Error ndn_BinaryXMLEncoder_writeBlob(struct ndn_BinaryXMLEncoder *self, unsigned char *value, unsigned int valueLength)
+ndn_Error ndn_BinaryXmlEncoder_writeBlob(struct ndn_BinaryXmlEncoder *self, unsigned char *value, unsigned int valueLength)
 {
   ndn_Error error;
-  if (error = ndn_BinaryXMLEncoder_encodeTypeAndValue(self, ndn_BinaryXML_BLOB, valueLength))
+  if (error = ndn_BinaryXmlEncoder_encodeTypeAndValue(self, ndn_BinaryXml_BLOB, valueLength))
     return error;
   
   if (error = writeArray(self, value, valueLength))
@@ -228,22 +228,22 @@
   return 0;
 }
 
-ndn_Error ndn_BinaryXMLEncoder_writeBlobDTagElement(struct ndn_BinaryXMLEncoder *self, unsigned int tag, unsigned char *value, unsigned int valueLength)
+ndn_Error ndn_BinaryXmlEncoder_writeBlobDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, unsigned char *value, unsigned int valueLength)
 {
   ndn_Error error;
-  if (error = ndn_BinaryXMLEncoder_writeElementStartDTag(self, tag))
+  if (error = ndn_BinaryXmlEncoder_writeElementStartDTag(self, tag))
     return error;
   
-  if (error = ndn_BinaryXMLEncoder_writeBlob(self, value, valueLength))
+  if (error = ndn_BinaryXmlEncoder_writeBlob(self, value, valueLength))
     return error;  
   
-  if (error = ndn_BinaryXMLEncoder_writeElementClose(self))
+  if (error = ndn_BinaryXmlEncoder_writeElementClose(self))
     return error;
   
   return 0;
 }
 
-ndn_Error ndn_BinaryXMLEncoder_writeUnsignedDecimalInt(struct ndn_BinaryXMLEncoder *self, unsigned int value)
+ndn_Error ndn_BinaryXmlEncoder_writeUnsignedDecimalInt(struct ndn_BinaryXmlEncoder *self, unsigned int value)
 {
   // First write the decimal int (to find out how many bytes it is), then shift it forward to make room for the header.
   unsigned int startOffset = self->offset;
@@ -252,28 +252,28 @@
   if (error = encodeReversedUnsignedDecimalInt(self, value))
     return error;
   
-  if (error = reverseBufferAndInsertHeader(self, startOffset, ndn_BinaryXML_UDATA))
+  if (error = reverseBufferAndInsertHeader(self, startOffset, ndn_BinaryXml_UDATA))
     return error;
   
   return 0;
 }
 
-ndn_Error ndn_BinaryXMLEncoder_writeUnsignedDecimalIntDTagElement(struct ndn_BinaryXMLEncoder *self, unsigned int tag, unsigned int value)
+ndn_Error ndn_BinaryXmlEncoder_writeUnsignedDecimalIntDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, unsigned int value)
 {
   ndn_Error error;
-  if (error = ndn_BinaryXMLEncoder_writeElementStartDTag(self, tag))
+  if (error = ndn_BinaryXmlEncoder_writeElementStartDTag(self, tag))
     return error;
   
-  if (error = ndn_BinaryXMLEncoder_writeUnsignedDecimalInt(self, value))
+  if (error = ndn_BinaryXmlEncoder_writeUnsignedDecimalInt(self, value))
     return error;  
   
-  if (error = ndn_BinaryXMLEncoder_writeElementClose(self))
+  if (error = ndn_BinaryXmlEncoder_writeElementClose(self))
     return error;
   
   return 0;
 }
 
-ndn_Error ndn_BinaryXMLEncoder_writeAbsDoubleBigEndianBlob(struct ndn_BinaryXMLEncoder *self, double value)
+ndn_Error ndn_BinaryXmlEncoder_writeAbsDoubleBigEndianBlob(struct ndn_BinaryXmlEncoder *self, double value)
 {
   unsigned long hi32, lo32;
   splitAbsDouble(value, &hi32, &lo32);
@@ -309,22 +309,22 @@
     }
   }
   
-  if (error = reverseBufferAndInsertHeader(self, startOffset, ndn_BinaryXML_BLOB))
+  if (error = reverseBufferAndInsertHeader(self, startOffset, ndn_BinaryXml_BLOB))
     return error;
   
   return 0;
 }
 
-ndn_Error ndn_BinaryXMLEncoder_writeTimeMillisecondsDTagElement(struct ndn_BinaryXMLEncoder *self, unsigned int tag, double milliseconds)
+ndn_Error ndn_BinaryXmlEncoder_writeTimeMillisecondsDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, double milliseconds)
 {
   ndn_Error error;
-  if (error = ndn_BinaryXMLEncoder_writeElementStartDTag(self, tag))
+  if (error = ndn_BinaryXmlEncoder_writeElementStartDTag(self, tag))
     return error;
    
-  if (error = ndn_BinaryXMLEncoder_writeAbsDoubleBigEndianBlob(self, (milliseconds / 1000.0) * 4096.0))
+  if (error = ndn_BinaryXmlEncoder_writeAbsDoubleBigEndianBlob(self, (milliseconds / 1000.0) * 4096.0))
     return error;
     
-  if (error = ndn_BinaryXMLEncoder_writeElementClose(self))
+  if (error = ndn_BinaryXmlEncoder_writeElementClose(self))
     return error;
   
   return 0;
