Parsing JavaScript objects to XML