Update js2xmlparser.js

If prettyPrinting is disabled, the last > is being removed from the XML. Instead of removing the last character, we use a regular expression to remove trailing whitespace.