adding character encoding to make sure we get the right parameters in place
minor updates to simplify the header
removing unused variables
removing deprecation notices
removing the old PHP4-based XML parsing in favor of SimpleXML