Add support for JSON and changes in xml_tree_factory