Configurable converter from XML to Javascript