In attributes, the behaviour shown is normal, actually, it is required by the XML spec, see Attribute Value Normalization.
I don't think the module does that in elements, except that it discards line returns followed by spaces between 2 tags (getting rid of non-significant whitespaces, as far as it can tell). you can turn this off using the keep_spaces option when you create the twig.
You could not-normalize attribute values by using the keep_encoding method and writing your own start tag parser (based on XML::Twig's own parser in _parse_start_tag) and using it through the parse_start_tag option. Not really simple, but you are trying to do non XML processing with an XML processor here.