• Quick note (for completeness), the inner query returns an XML, the value() method is invoked on that XML

    😎

    (inner query returning XML).value() <--the value method on the XML data type.