Towards semantic documents for digital libraries and document repositories