PHP & JavaScript XML Fixes