Please please please don't use json lib to parse XML. This is very unprofessional and can not be reused at all.
It can parse " <Element1 name=\"abc\"  id=\"123\"> </Element1>"  ok
What about "<Element1><name>abc</name> <id>123</id></Element1>" ?

I really think if it's xml parser for general purpose. It must use some professional xml parser library, parsing according to some certain xml schema
I think all enterprise xml protocol/format will have some certain xml schema