In the future please make a better effort to post readable code.
You can solve your problem by using xmlforest instead of xmlelement:
SELECT xmlforest( xmlforest( xmlagg(xmldoc order by sort_ord, data_date DESC) as "AssetValues" ) as "Profile" ) FROM xml_data;
Output for 1. example:
<Profile><AssetValues><DailyTNA Currency="USD" Date="2014-12-18">3510000.0</DailyTNA><SharesOutstanding Date="2013-12-31">17178383.0</SharesOutstanding></AssetValues></Profile>
Output for 2.example:
Thanks a lot for your help. Sure, will take care next time to place the question in a readable format.