Added in XML generator to response.

Added in an XML generator to response, will need to rewrite xml_encode
as the version I have found is too clever.
Fix some formatting and import DOMDocument

DOMDocument needs to be imported as it is not in the correct namespace.
Remove overly clever plurals code

This just removes the overly complicated piece of 'plurals' code, which
takes any point with an 's' on the end and splits it up.
Replace with more usable encode algorithm.