Try this:
;WITH XMLNAMESPACES (DEFAULT 'http://www.ecb.int/vocabulary/2002-08-01/eurofxref',
'http://www.gesmes.org/xml/2002-08-01' AS ns)
SELECT
FXDate = FXDate.value('../@time', 'varchar(100)'),
FXCurrency = FXDate.value('@currency','varchar(100)'),
FXRate = FXDate.value('@rate','varchar(100)')
FROM
@XML.nodes('ns:Envelope/Cube/Cube/Cube') as Test(FXDate)
Basically, the default XML namespace in your XML should be used as the default XML namespace in your query as well, and the second XML namespace just is listed with some prefix of your choice.
Also, your XPath was wrong in using /Root
at the top - the root element is called <Envelope>
in your XML here.
I also removed the CROSS APPLY
since it doesn't seem to be necessary - just select the lowest level <Cube>
entry and then use ../@time
to reference the "one-level up" attribute on the "parent" <Cube>
XML element.