I'm creating a mediator type of application using nodejs. it process (transform, search using xpath, etc) XML. there are more than one processing unite in the application and the XML message will be carring the data between these unites. I think i have two choices
I want to know whether the second option is possible (can perform similar tasks done to xml) and if it is possible then which one is more suitable (performance, etc) to use with nodejs application. I'm new to nodejs and I hope this one won't be a dumb question.
thanks in advace
It depends on the content of the XML.
There is no complete mapping between XML and Json (most obvious are element attributes and entity references), so if there is anything in your XML that is not portable to Json you won't be able to do that (at least not without some tinkering).
But in most use-cases, it's very easy to convert an xml to json, the question that arises is why do it? The most obvious reason is that Json is easier to work with in node (you can access properties directly, etc...), so if you are doing a lot of work with the object, it might be worth it. 
If the object is big, the conversion between xml and json might not be worth it (and there's also streaming parsers for xml, that is, you can work only with part of the xml object without parsing all of it, Json doesn't have great support for such).