Instead of
<pre>
  lp_encode(&chunks[0], &chunks[k+m], blocksize);
</pre>
it would be
<pre>
  lp = new ErasureCodeXOR(); // same style as new ErasureCodeJerasureCauchyOrig();
  for range_of_chunk in want_to_encode / lp
   bufferlist local
   for chunk_id in range_of_chunk:
      local.append(in.get_bufferptr(chunk_id))
   lp->encode(range_of_chunk, local, encoded)
</pre>
and the maths currently in lp_encode/decode would go to xor.cc or something.

What do you think ?