diff --git a/include/sync-state.h b/include/sync-state.h
index 826e84d..c96160e 100644
--- a/include/sync-state.h
+++ b/include/sync-state.h
@@ -26,6 +26,7 @@
 #include "sync-state-leaf-container.h"
 #include <boost/exception/all.hpp>
 #include "boost/tuple/tuple.hpp"
+#include "sync-state.pb.h"
 
 /**
  * \defgroup sync SYNC protocol
@@ -74,29 +75,31 @@
   LeafContainer m_leaves;
 };
 
-/**
- * @brief Formats an XML representation of the state
- * @param os output stream
- * @param state state
- * @returns output stream
- */
-std::ostream &
-operator << (std::ostream &os, const State &state);
 
 /**
- * @brief Parses an XML representation to the state
- * @param in input data stream
+ * @brief Formats a protobuf SyncStateMsg msg
+ * @param oss output SyncStateMsg msg
  * @param state state
- * @returns input stream
+ * @returns output SyncStateMsg msg
  */
-std::istream &
-operator >> (std::istream &in, State &state);
+SyncStateMsg &
+operator << (SyncStateMsg &ossm, const State &state);
+
+
+/**
+ * @brief Parse a protobuf SyncStateMsg msg
+ * @param iss input SyncStateMsg msg
+ * @param state state
+ * @returns SyncStateMsg msg
+ */
+SyncStateMsg &
+operator >> (SyncStateMsg &issm, const State &state);
 
 namespace Error {
 /**
- * @brief Will be thrown when XML cannot be properly decoded to State
+ * @brief Will be thrown when data cannot be properly decoded to SyncStateMsg
  */
-struct SyncXmlDecodingFailure : virtual boost::exception, virtual std::exception { };
+struct SyncStateMsgDecodingFailure : virtual boost::exception, virtual std::exception { };
 }
 
 } // Sync
diff --git a/model/sync-logic.cc b/model/sync-logic.cc
index 860f119..943126b 100644
--- a/model/sync-logic.cc
+++ b/model/sync-logic.cc
@@ -178,7 +178,7 @@
 }
 
 void
-SyncLogic::respondSyncData (const std::string &name, const std::string &dataBuffer)
+SyncLogic::respondSyncData (const std::string &name, const char *wireData, size_t len)
 {
   try
     {
@@ -190,13 +190,13 @@
 
       if (type == "normal")
         {
-          processSyncData (name, digest, dataBuffer);
+          processSyncData (name, digest, wireData, len);
         }
       else
         {
           // timer is always restarted when we schedule recovery
           m_scheduler.cancel (REEXPRESSING_RECOVERY_INTEREST);
-          processSyncData (name, digest, dataBuffer);
+          processSyncData (name, digest, wireData, len);
         }
     }
   catch (Error::DigestCalculationError &e)
@@ -263,7 +263,7 @@
 }
 
 void
-SyncLogic::processSyncData (const std::string &name, DigestConstPtr digest, const string &dataBuffer)
+SyncLogic::processSyncData (const std::string &name, DigestConstPtr digest, const char *wireData, size_t len)
 {
   DiffStatePtr diffLog = make_shared<DiffState> ();
   bool ownInterestSatisfied = false;
@@ -277,8 +277,14 @@
       ownInterestSatisfied = (name == m_outstandingInterestName);
 
       DiffState diff;
-      istringstream ss (dataBuffer);
-      ss >> diff;
+      SyncStateMsg msg;
+      if (!msg.parseFromArray(wireData, len) || !msg.IsInitialized()) 
+      {
+        //Throw
+        BOOST_THROW_EXCEPTION (SyncStateMsgDecodingFailure () << info_str ("Can not decode data"));
+      }
+      msg >> diff;
+
       vector<MissingDataInfo> v;
       BOOST_FOREACH (LeafConstPtr leaf, diff.getLeaves().get<ordered>())
         {
@@ -332,7 +338,7 @@
 
       insertToDiffLog (diffLog);
     }
-  catch (Error::SyncXmlDecodingFailure &e)
+  catch (Error::SyncStateMsgDecodingFailure &e)
     {
       _LOG_TRACE ("Something really fishy happened during state decoding " <<
                   diagnostic_information (e));
@@ -486,8 +492,8 @@
                         bind (&SyncLogic::sendSyncInterest, this),
                         REEXPRESSING_INTEREST);
   
-  m_ccnxHandle->sendInterestForString (os.str (),
-                              bind (&SyncLogic::respondSyncData, this, _1, _2));
+  m_ccnxHandle->sendInterest (os.str (),
+                              bind (&SyncLogic::respondSyncData, this, _1, _2, _3));
 }
 
 void
@@ -508,8 +514,8 @@
                             REEXPRESSING_RECOVERY_INTEREST);
     }
 
-  m_ccnxHandle->sendInterestForString (os.str (),
-                              bind (&SyncLogic::respondSyncData, this, _1, _2));
+  m_ccnxHandle->sendInterest (os.str (),
+                              bind (&SyncLogic::respondSyncData, this, _1, _2, _3));
 }
 
 
@@ -518,9 +524,15 @@
 {
   _LOG_TRACE (">> D " << name);
   // sending
-  m_ccnxHandle->publishStringData (name,
-                             lexical_cast<string> (*state),
+  SyncStateMsg ssm;
+  ssm << (*state);
+  char *wireData = new char[ssm.size()];
+  ssm.SerializedToArray(wireData, ssm.size());
+  m_ccnxHandle->publishRawData (name,
+                             wireData,
+                             ssm.size(),
                              m_syncResponseFreshness); // in NS-3 it doesn't have any effect... yet
+  delete wireData;
 
   // checking if our own interest got satisfied
   bool satisfiedOwnInterest = false;
diff --git a/model/sync-state.cc b/model/sync-state.cc
index f6db146..45a7ab7 100644
--- a/model/sync-state.cc
+++ b/model/sync-state.cc
@@ -30,7 +30,6 @@
 #include <boost/throw_exception.hpp>
 #include <boost/lexical_cast.hpp>
 
-#define TIXML_USE_STL
 #include <tinyxml.h>
 
 using namespace std;
@@ -42,12 +41,7 @@
 
 namespace Sync {
 
-#ifdef _DEBUG
-#define DEBUG_ENDL os << "\n";
-#else
-#define DEBUG_ENDL
-#endif
-
+/*
 std::ostream &
 operator << (std::ostream &os, const State &state)
 {
@@ -73,7 +67,40 @@
     }
   os << "</state>";
 }
+*/
 
+SyncStateMsg &
+operator << (SyncStateMsg &ossm, const State &state)
+{
+  BOOST_FOREACH (shared_ptr<const Leaf> leaf, state.getLeaves ().get<ordered> ())
+  {
+    SyncState *oss = ossm->add_ss();
+    shared_ptr<const DiffLeaf> diffLeaf = dynamic_pointer_cast<const DiffLeaf> (leaf);
+    if (diffLeaf != 0 && diffLeaf->getOperation != UPDATE)
+    {
+      oss->set_type(SyncState::DELETE);
+    }
+    else
+    {
+      oss->set_type(SyncState::UPDATE);
+    }
+
+    std::ostringstream os;
+    os << *leaf->getInfo();
+    oss->set_name(os.str());
+
+    if (diffLeaf == 0 || (diffLeaf != 0 && diffLeaf->getOperation () == UPDATE))
+    {
+      SyncState::SeqNo seqNo;
+      seqNo->set_session(leaf->getSeq()->getSession());
+      seqNo->set_seq(leaf->getSeq()->getSeq());
+      oss->set_seqNo(seqNo);
+    }
+  }
+  return ossm;
+}
+
+/*
 std::istream &
 operator >> (std::istream &in, State &state)
 {
@@ -120,5 +147,29 @@
 
   return in;
 }
+*/
+
+SyncStateMsg &
+operator >> (SyncStateMsg &issm, const State &state)
+{
+  int n = issm.ss_size();
+  for (int i = 0; i < n; i++)
+  {
+    const SyncState &ss = issm.ss(i);
+    NameInfoConstPtr info = StdNameInfo::FindOrCreate (ss.name());
+    if (ss.type() == SyncState::UPDATE)
+    {
+      state.update(info, SeqNo(
+                                lexical_cast<uint32_t> (ss.seqNo().session()),
+                                lexical_cast<uint32_t> (ss.seqNo().seq()),
+                                ));
+    }
+    else
+    {
+      state.remove(info);
+    }
+  }
+  return issm;
+}
 
 }
diff --git a/proto/sync-state.proto b/proto/sync-state.proto
new file mode 100644
index 0000000..71bd1e7
--- /dev/null
+++ b/proto/sync-state.proto
@@ -0,0 +1,24 @@
+package Sync;
+
+message SyncState
+{
+  required string name = 1;
+  enum ActionType
+  {
+    UPDATE = 0;
+    DELETE = 1;
+    OTHER = 2;
+  }
+  required ActionType type = 2;
+  message SeqNo
+  {
+    required uint32 seq = 1;
+    required uint32 session = 2;
+  }
+  optional SeqNo seqNo = 3;
+}
+
+message SyncStateMsg
+{
+  repeated SyncState ss = 1;
+}
