Thanks for sharing!
Personally I would just add text to variable and then output the variable instead of using XML document.
When I this when testing:
PHP Code:
return "\t" . '<server>' . "\n"
. "\t\t" . '<id>' . $server[ 'id' ] . '</id>' . "\n"
. "\t\t" . '<ip>' . $server[ 'ipAddress' ] . '</ip>' . "\n"
. "\t\t" . '<port>' . $server[ 'portNumber' ] . '</port>' . "\n"
. "\t\t" . '<category sort="1">' . $server[ 'serverType' ] . ' (' . $server[ 'countryTag' ] . ')</category>' . "\n"
. "\t\t" . '<name raw_name="' . $server[ 'name' ] . '"><![CDATA[' . $server[ 'name' ] . ' (' . $server[ 'status' ] . ')]]></name>' . "\n"
. "\t\t" . '<crowdness sort="1">None</crowdness>' . "\n"
. "\t\t" . '<open sort="1">Low</open>' . "\n"
. "\t\t" . '<permission_mask>0x00000000</permission_mask>' . "\n"
. "\t\t" . '<server_stat>0x00000000</server_stat>' . "\n"
. "\t\t" . '<popup><![CDATA[Unable to access the server at this time.]]></popup>' . "\n"
. "\t\t" . '<language>en</language>' . "\n"
. "\t" . '</server>' . "\n";
It works same way, but is much shorter (I don't know if faster). It gets data from MySQL database and then do small parsing (server mode is hold as tinyint rather than string, so it converts eg. 1 to PvP). The additional parts (county tag and status) are for future use, it will be available at end of next month. Also I will remove tabs and newlines as they are not needed and it will make file size smaller and so transfer will be smaller.
Also I am thinking about doing something for servers owners, simple and easy to use website with account management, highscores and others things. Were you thinking about doing something like this?