add rack middleware to return parsed XML as JSON