support recursive complex types

This patch allows to use complex types which are recursive (ie have a property or child which points to itself).