diff --git a/Makefile.am b/Makefile.am
index a6818df..4533a01 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -81,6 +81,7 @@
   src/encoding/binary-xml-decoder.hpp \
   src/encoding/binary-xml-encoder.hpp \
   src/encoding/binary-xml-structure-decoder.hpp \
+  src/encoding/binary-xml-wire-format.cpp \
   src/encoding/block.cpp \
   src/encoding/cryptopp/asn_ext.cpp \
   src/encoding/cryptopp/asn_ext.hpp \
@@ -119,11 +120,6 @@
   src/util/string-helper.hpp \
   src/util/time.hpp
 
-# Temporary disabled:
-#   data/interest/forwardingEntry set/get methods need to be 
-#   embedded in BinaryXmlWireFormat class
-# src/encoding/binary-xml-wire-format.cpp
-
 libndn_cpp_la_LIBADD  = @OPENSSL_LIBS@ @OSX_SECURITY_LIBS@
 libndn_cpp_la_LDFLAGS = @OPENSSL_LDFLAGS@  @SQLITE3_LDFLAGS@ @BOOST_LDFLAGS@
 libndn_cpp_la_CFLAGS  = @OPENSSL_INCLUDES@ @SQLITE3_CFLAGS@  @BOOST_CPPFLAGS@
diff --git a/include/ndn-cpp/exclude.hpp b/include/ndn-cpp/exclude.hpp
index 276aa5b..e26ec31 100644
--- a/include/ndn-cpp/exclude.hpp
+++ b/include/ndn-cpp/exclude.hpp
@@ -95,6 +95,12 @@
    */
   inline bool
   empty () const;
+
+  /**
+   * @brief Clear the exclude filter
+   */
+  inline void
+  clear();
   
   /**
    * @brief Get number of exclude terms
@@ -177,6 +183,13 @@
   return m_exclude.empty ();
 }
 
+inline void
+Exclude::clear ()
+{
+  m_exclude.clear ();
+}
+
+
 inline size_t
 Exclude::size () const
 {
diff --git a/include/ndn-cpp/interest.hpp b/include/ndn-cpp/interest.hpp
index e55a554..8fe3119 100644
--- a/include/ndn-cpp/interest.hpp
+++ b/include/ndn-cpp/interest.hpp
@@ -136,8 +136,10 @@
    * @brief Get Interest's nonce
    *
    * If nonce was not set before this call, it will be automatically assigned to a random value
+   *
+   * Const reference needed for C decoding
    */
-  uint32_t
+  const uint32_t&
   getNonce() const;
     
   void
diff --git a/src/c/encoding/binary-xml-decoder.c b/src/c/encoding/binary-xml-decoder.c
index d3b4d22..110ce51 100644
--- a/src/c/encoding/binary-xml-decoder.c
+++ b/src/c/encoding/binary-xml-decoder.c
@@ -293,7 +293,7 @@
 }
 
 ndn_Error ndn_BinaryXmlDecoder_readTimeMillisecondsDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, double *milliseconds)
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, ndn_MillisecondsSince1970 *milliseconds)
 {
   ndn_Error error;
   struct ndn_Blob bytes;
@@ -305,7 +305,7 @@
 }
 
 ndn_Error ndn_BinaryXmlDecoder_readOptionalTimeMillisecondsDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, double *milliseconds)
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, ndn_MillisecondsSince1970 *milliseconds)
 {
   int gotExpectedTag;
   ndn_Error error;
diff --git a/src/c/encoding/binary-xml-decoder.h b/src/c/encoding/binary-xml-decoder.h
index 5072b97..3f427c1 100644
--- a/src/c/encoding/binary-xml-decoder.h
+++ b/src/c/encoding/binary-xml-decoder.h
@@ -156,7 +156,7 @@
  * @return 0 for success, else an error code, including an error if not the expected tag
  */
 ndn_Error ndn_BinaryXmlDecoder_readTimeMillisecondsDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, double *milliseconds);
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, ndn_MillisecondsSince1970 *milliseconds);
 
 /**
  * Peek at the next element, and if it has the expectedTag then call ndn_BinaryXmlDecoder_readTimeMillisecondsDTagElement.
@@ -167,7 +167,7 @@
  * @return 0 for success, else an error code
  */
 ndn_Error ndn_BinaryXmlDecoder_readOptionalTimeMillisecondsDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, double *milliseconds);
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, ndn_MillisecondsSince1970 *milliseconds);
 
 /**
  * Interpret the bytes as an unsigned big endian integer and convert to a double. Don't check for overflow.
diff --git a/src/encoding/binary-xml-wire-format.cpp b/src/encoding/binary-xml-wire-format.cpp
index e463e91..73d8fd6 100644
--- a/src/encoding/binary-xml-wire-format.cpp
+++ b/src/encoding/binary-xml-wire-format.cpp
@@ -20,6 +20,204 @@
 
 namespace ndn {
 
+namespace c {
+
+class Exclude : public ndn::Exclude
+{
+public:
+  void
+  get(struct ndn_Exclude& excludeStruct) const
+  {
+    if (excludeStruct.maxEntries < size())
+      throw runtime_error("excludeStruct.maxEntries must be >= this exclude getEntryCount()");
+
+    int entries = 0;
+    for (Exclude::const_reverse_iterator i = rbegin (); i != rend (); i++)
+      {
+        if (!i->first.empty())
+          {
+            excludeStruct.entries[entries].type = ndn_Exclude_COMPONENT;
+            excludeStruct.entries[entries].component.value.value = const_cast<uint8_t*>(i->first.getValue().buf());
+            excludeStruct.entries[entries].component.value.length = i->first.getValue().size();
+            ++entries;
+          }
+        if (i->second)
+          {
+            excludeStruct.entries[entries].type = ndn_Exclude_ANY;
+            ++entries;
+          }
+      }
+
+    excludeStruct.nEntries = entries;
+  }
+
+  void
+  set(const struct ndn_Exclude& excludeStruct)
+  {
+    clear();
+
+    if (excludeStruct.nEntries == 0)
+      return;
+
+    int i = 0;
+    if (excludeStruct.entries[i].type == ndn_Exclude_ANY) {
+      appendExclude("/", true);
+      i++;
+    }
+
+    while (i < excludeStruct.nEntries) {
+      ndn_ExcludeEntry *entry = &excludeStruct.entries[i];
+
+      if (entry->type != ndn_Exclude_COMPONENT)
+        throw runtime_error("unrecognized ndn_ExcludeType");
+
+      Name::Component excludedComponent (entry->component.value.value, entry->component.value.length);
+      ++i;
+      entry = &excludeStruct.entries[i];
+
+      if (i < excludeStruct.nEntries) {
+        if (entry->type == ndn_Exclude_ANY) {
+          appendExclude(excludedComponent, true);
+          ++i;
+        }
+        else
+          appendExclude(excludedComponent, false);
+      }
+      else
+        appendExclude(excludedComponent, false);
+    }
+  }
+};
+
+class Name : public ndn::Name
+{
+public:
+  void 
+  get(struct ndn_Name& nameStruct) const
+  {
+    if (nameStruct.maxComponents < size())
+      throw runtime_error("nameStruct.maxComponents must be >= this name getNComponents()");
+  
+    nameStruct.nComponents = size();
+    for (size_t i = 0; i < nameStruct.nComponents; ++i) {
+      nameStruct.components[i].value.value = const_cast<uint8_t*>(ndn::Name::get(i).getValue().buf());
+      nameStruct.components[i].value.length = ndn::Name::get(i).getValue().size();
+    }
+  }
+  
+  void 
+  set(const struct ndn_Name& nameStruct) 
+  {
+    clear();
+    for (size_t i = 0; i < nameStruct.nComponents; ++i)
+      append(nameStruct.components[i].value.value, nameStruct.components[i].value.length);  
+  }
+};
+
+class Interest : public ndn::Interest
+{
+public:
+  void 
+  get(struct ndn_Interest& interestStruct) const 
+  {
+    reinterpret_cast<const c::Name&>(getName()).get(interestStruct.name);
+    interestStruct.minSuffixComponents = getMinSuffixComponents();
+    interestStruct.maxSuffixComponents = getMaxSuffixComponents();
+    // publisherPublicKeyDigest_.get(interestStruct.publisherPublicKeyDigest);
+    reinterpret_cast<const c::Exclude&>(getExclude()).get(interestStruct.exclude);
+    interestStruct.childSelector = getChildSelector();
+    interestStruct.answerOriginKind = getMustBeFresh() ?
+      (ndn_Interest_ANSWER_CONTENT_STORE | ndn_Interest_ANSWER_GENERATED)
+      :
+      (ndn_Interest_ANSWER_CONTENT_STORE | ndn_Interest_ANSWER_GENERATED | ndn_Interest_ANSWER_STALE);
+    interestStruct.scope = getScope();
+    interestStruct.interestLifetimeMilliseconds = getInterestLifetime();
+
+    interestStruct.nonce.length = 4;
+    interestStruct.nonce.value = const_cast<uint8_t*>(reinterpret_cast<const uint8_t *>(getNonce()));
+  }  
+
+  void 
+  set(const struct ndn_Interest& interestStruct) 
+  {
+    reinterpret_cast<c::Name&>(getName()).set(interestStruct.name);
+    setMinSuffixComponents(interestStruct.minSuffixComponents);
+    setMaxSuffixComponents(interestStruct.maxSuffixComponents);
+  
+    // publisherPublicKeyDigest_.set(interestStruct.publisherPublicKeyDigest);
+  
+    reinterpret_cast<c::Exclude&>(getExclude()).set(interestStruct.exclude);
+    setChildSelector(interestStruct.childSelector);
+    // answerOriginKind_ = interestStruct.answerOriginKind;
+    setScope(interestStruct.scope);
+    setInterestLifetime(interestStruct.interestLifetimeMilliseconds);
+
+    setNonce(*reinterpret_cast<uint32_t*>(interestStruct.nonce.value));
+  }
+};
+
+class Data : public ndn::Data
+{
+public:
+  void 
+  get(struct ndn_Data& dataStruct) const 
+  {
+    // signature_->get(dataStruct.signature);
+    // name_.get(dataStruct.name);
+    // metaInfo_.get(dataStruct.metaInfo);
+    // content_.get(dataStruct.content);
+  }
+
+  void 
+  set(const struct ndn_Data& dataStruct)
+  {
+    // signature_->set(dataStruct.signature);
+    // name_.set(dataStruct.name);
+    // metaInfo_.set(dataStruct.metaInfo);
+    // content_ = Blob(dataStruct.content);
+  }
+};
+
+class ForwardingEntry : public ndn::ForwardingEntry
+{
+public:
+  void 
+  get(struct ndn_ForwardingEntry& forwardingEntryStruct) const 
+  {
+    reinterpret_cast<const c::Name&>(getPrefix()).get(forwardingEntryStruct.prefix);
+    // publisherPublicKeyDigest_.get(forwardingEntryStruct.publisherPublicKeyDigest);
+    forwardingEntryStruct.faceId = getFaceId();
+    // forwardingEntryStruct.forwardingFlags = getForwardingFlags();
+    forwardingEntryStruct.freshnessSeconds = getFreshnessPeriod() / 1000;
+
+    forwardingEntryStruct.action.length = getAction().size();
+    if (getAction().size() > 0)
+      forwardingEntryStruct.action.value = (uint8_t *)&getAction();
+    else
+      forwardingEntryStruct.action.value = 0;
+  }
+
+  void 
+  set(const struct ndn_ForwardingEntry& forwardingEntryStruct) 
+  {
+    if (forwardingEntryStruct.action.value && forwardingEntryStruct.action.length > 0)
+      setAction(string(forwardingEntryStruct.action.value, forwardingEntryStruct.action.value + forwardingEntryStruct.action.length));
+    else
+      setAction("");
+
+    Name prefix;
+    reinterpret_cast<c::Name&>(prefix).set(forwardingEntryStruct.prefix);
+    setPrefix(prefix);
+    // publisherPublicKeyDigest_.set(forwardingEntryStruct.publisherPublicKeyDigest);  
+    setFaceId(forwardingEntryStruct.faceId);
+    // setForwardingFlags(forwardingEntryStruct.forwardingFlags);
+    setFreshnessPeriod(forwardingEntryStruct.freshnessSeconds * 1000);
+  }
+};
+
+}
+
+
 // This is declared in the WireFormat class.
 WireFormat*
 WireFormat::newInitialDefaultWireFormat() 
@@ -36,7 +234,7 @@
   ndn_Interest_initialize
     (&interestStruct, nameComponents, sizeof(nameComponents) / sizeof(nameComponents[0]), 
      excludeEntries, sizeof(excludeEntries) / sizeof(excludeEntries[0]));
-  interest.get(interestStruct);
+  reinterpret_cast<const c::Interest&>(interest).get(interestStruct);
 
   BinaryXmlEncoder encoder;
   ndn_Error error;
@@ -61,7 +259,7 @@
   if ((error = ndn_decodeBinaryXmlInterest(&interestStruct, &decoder)))
     throw runtime_error(ndn_getErrorString(error));
 
-  interest.set(interestStruct);
+  reinterpret_cast<c::Interest&>(interest).set(interestStruct);
 }
 
 Blob 
@@ -73,7 +271,7 @@
   ndn_Data_initialize
     (&dataStruct, nameComponents, sizeof(nameComponents) / sizeof(nameComponents[0]), 
      keyNameComponents, sizeof(keyNameComponents) / sizeof(keyNameComponents[0]));
-  data.get(dataStruct);
+  reinterpret_cast<const c::Data&>(data).get(dataStruct);
 
   BinaryXmlEncoder encoder(1500);
   ndn_Error error;
@@ -99,7 +297,7 @@
   if ((error = ndn_decodeBinaryXmlData(&dataStruct, signedPortionBeginOffset, signedPortionEndOffset, &decoder)))
     throw runtime_error(ndn_getErrorString(error));
 
-  data.set(dataStruct);
+  reinterpret_cast<c::Data&>(data).set(dataStruct);
 }
 
 Blob 
@@ -109,7 +307,7 @@
   struct ndn_ForwardingEntry forwardingEntryStruct;
   ndn_ForwardingEntry_initialize
     (&forwardingEntryStruct, prefixNameComponents, sizeof(prefixNameComponents) / sizeof(prefixNameComponents[0]));
-  forwardingEntry.get(forwardingEntryStruct);
+  reinterpret_cast<const c::ForwardingEntry&>(forwardingEntry).get(forwardingEntryStruct);
 
   BinaryXmlEncoder encoder;
   ndn_Error error;
@@ -132,7 +330,7 @@
   if ((error = ndn_decodeBinaryXmlForwardingEntry(&forwardingEntryStruct, &decoder)))
     throw runtime_error(ndn_getErrorString(error));
 
-  forwardingEntry.set(forwardingEntryStruct);
+  reinterpret_cast<c::ForwardingEntry&>(forwardingEntry).set(forwardingEntryStruct);
 }
 
 }
diff --git a/src/interest.cpp b/src/interest.cpp
index 85ce0c1..b9048ed 100644
--- a/src/interest.cpp
+++ b/src/interest.cpp
@@ -9,13 +9,26 @@
 #include <ndn-cpp/common.hpp>
 #include <ndn-cpp/interest.hpp>
 
+#if __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wreorder"
+#pragma clang diagnostic ignored "-Wtautological-compare"
+#pragma clang diagnostic ignored "-Wunused-variable"
+#pragma clang diagnostic ignored "-Wunused-function"
+#elif __GNUC__
+#pragma GCC diagnostic ignored "-Wreorder"
+#pragma GCC diagnostic ignored "-Wtautological-compare"
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+#endif
+
 #include <cryptopp/osrng.h>
 
 using namespace std;
 
 namespace ndn {
 
-uint32_t
+const uint32_t&
 Interest::getNonce() const
 {
   static CryptoPP::AutoSeededRandomPool rng;
