changed saveHTML into saveXML so that it works on the server