cod2txt - xmage compatible (as import, not directly)