PgSQL function to test schema XML