ConverterTrait improved for toXML and toHTML methods