XML to JSON. First working version. Beware of cyclic inspect problems.