Store the resulting value in one extra byte at the end of the file.
In the first stage, the digital content is digested and the resulting value is placed in an XML element.
However, for any power of two, this will give you a guarantee that no matter what your starting value is, the resulting value will be aligned to a multiple of that many bytes.