API returns you data only (document tree). You could specify via query parameter whether you want to receive XML (this is what you've got) or JSON. Usually when you make a call from javascript you need JSON.
So once you get data back from API just process it and present on the UI the way you need.
There are frameworks like Angular those do good job with rendering UI based on data model.
If this does not help, please provide more information on what is that you're trying to achieve and what is wrong with what you get.