[jQuery] jQuery xml2json problems when siblings of the same tagname only have a textNode as a child

[jQuery] jQuery xml2json problems when siblings of the same tagname only have a textNode as a child


I found this plugin for converting xml to json which I need for my
application at least temporarily until the server can get me JSON
directly. The jQuery Plugin to convert xml to json works pretty good
it seems but i've found a bug.
I have a structure that looks like something this:
<EventLog>
<Events>
<Event>
<EventNumber>1</EventNumber>
<Type>TimeChange</Type>
<Result>0</Result>
<BayData>25'-Long (Green ) PL_</BayData>
<BayData>35'-Long (Orange) PL_</BayData>
<BayData>25'-Long (Green ) PL_</BayData>
</Event>
<Event>
<EventNumber>2</EventNumber>
<Type>Update</Type>
<Result>1</Result>
<BayData>25'-Long (Green ) PL_</BayData>
<BayData>35'-Long (Orange) PL_</BayData>
<BayData>25'-Long (Green ) PL_</BayData>
</Event>
</Events>
</EventLog>
My problem is that although the xml to json conversion contains an
array of events, there will only be 1 BayData node for each event even
though there are 3 (thus, it should convert to an array).
This is definitely a bug.
I tried to figure out what code to change but so far no luck.
I tried another xml2json tool (http://www.thomasfrank.se/
xml_to_json.html) and it didnt have this problem, however it converted
tags to lowercase which I don't want because in the future the json i
get from the server (if that ever gets implemented) will have tags
beginning with uppercase (not my decision). I tried taking out the
line which converted the tags to lowercase with the thomasfrank
version and that broke the parser and I wasn't sure what to change
there either.
Any help would be greatly appreciated