TLV (Tag, Length, Value) is a powerful system for encoding data.

  • Tag: type of the data
  • Length: length of the data
  • Value: content of the data

It may then be used as a nested structure to become more interesting!

( T L (TLV)(TLV) )
where the first TLV structure encapsulate the next two.

This kind of data structure is also used in the Basic Encoding Rules(BER) and is in fact really close to the XML format.