Generate writing system metadata during xhtml export

* Generate language metadata as per LT-15926
* Fix XHTML export (LT-15919)

Change-Id: Ibbe0c8b08ecf836fefa0642b154bdb8e04fa5b9d