Functions and SQL code to retrieve g standard as xml

Cheers,
Peter