When a written language has no resemblance to English, such as Arabic or Chinese, what are the rules for writing words in English and who made them? Chinese history is peppered with words like Xin and Qing that have odd spellings. Then there's people like Empress Xiaozhuangwen. I mean couldn't there have been a better way to spell that? What's going on here?
Arabic actually has some relation to English. English uses a Latin alphabet, which developed from the Greek alphabet, which in turn is derived from the Phoenician alphabet, which also serves as the basis for the Arabic alphabet (technically it's an abjad, but that distinction doesn't matter in this context). So you can trace the letter B for example back through this chain to the Arabic letter Ba.
Languages that are completely unrelated (or at least of an unknown relationship) like Chinese or Japanese, are generally represented so that the reader can figure out how to pronounce it as close to the way it sounds coming from a native speaker. When the original language has sounds that don't exist in english, like the zh sound, it can get really weird looking, but that's the trade off you have to make.
In many cases, there aren't any rules. Hebrew has some standards that the Israeli government might use for signs, but they're not used in practice. Generally, people kind of spell things the way they want. Common terms have may have a set spelling, but no one decided--it was simply the standard that emerged.
Some languages have had more success with official Romanizations. Yiddish has a system used by YIVO, the Yiddish-language standards body, but in practice it's widely ignored unless you're transliterating a block of text--individual words' spelling bears little resemblance to it.
In the case of Chinese, there are a few Romanization systems. The two largest ones are Wade-Giles, which is older (late 19th century) and Pinyin (mid 20th century). These are official systems, which were developed by a people interested in assisting the use of Chinese in Latin characters. The first was made by a guy named Thomas Wade, a British diplomat in China, who wrote a few books on Chinese languages. The second was made mostly by a guy named Zhou Youguang, who had studied linguistics and was on a government committee to improve literacy in the 1950s.
Generally, you get weird spellings because transliterations often try to preserve sound distinctions that don't exist in English. For instance, we spell "Iraq" with a q because it represents a sound in Arabic we lack in English, whose letter is related to the letter "q" historically. In the case of Chinese, q and x represent sounds English lacks, so the spelling looks a bit funky.
You may also want to try /r/AskLinguistics or /r/Linguistics or even /r/AskSocialScience (they have linguists!).
It varied a great deal from language to language. I know that the Vietnamese transliteration (which eventually became the official way of writing Vietnamese) was put together by a French monk during the French colonization of the area.
In regards to your comments about Chinese:
Of course Chinese is full of words that have "odd" spellings. Mandarin (and Cantonese, for that matter) doesn't sound like English, so the transliterations reflect that. The transliterations use English letters that sound similar to the Chinese sounds. The "x" in Pinyin (the most wide-spread transliteration for Mandarin) represents a sound that is somewhat similar to the English x. That sound is used far more in Mandarin than the x sound is in English, so there's lots of words that are full of x's and therefore look "oddly spelled".
As for Xiaozhuangwen, that's a pretty good way of spelling it. Aside from the "x" and "zh", that name is pronounced fairly similarly to how it would be if that was English, so it makes perfect sense for those parts to be written as they are. As for the sounds I mentioned, well, something needs to represent those sounds, and "x" and "zh" are the best approximations one can make with English sounds.