Updated error message.
Cleaning up the code. Now the page returns a 404 error if no XML was generated.
Massive code changes. Using regex.