An encoding methodology encodes an instance document describing multimedia
content by determining a context node in the content description and
using a schema associated with the context node to determine the maximum
number of children attributes and elements of the context node. Values
for required attributes and elements are encoded into required attributes
and required elements sections, respectively. Values for each optional
attribute and optional element present in the content description are
encoded into corresponding optional attributes and optional elements
sections. In one aspect, a mask is encoded that indicates which of the
optional attributes or optional elements are present in the content
description. In another aspect, a count of the optional attributes or
optional elements is used in place of the mask. A corresponding decode
methodology extracts the values of the attributes and elements from the
encoded instance document to re-create the content description.