Add code to gather attributes and values (preliminary version).