Refactored ToString to support pattern of <[ns:]name/> output for empty object.