Fixed json output.
Support self closing tags.