SQLServer has a very useful function called OPENXML. It works is used like this:
DECLARE @idoc int
DECLARE @doc varchar(1000)
SET @doc =\'
I'm sure this code can be improved, but this appears to return the same result in Postgres as the code you posted does in SQL Server.
WITH test_xml(data) AS (VALUES
('
'::XML)
)
SELECT unnest((xpath('//Customer/@CustomerID', test_xml.data))),
unnest((xpath('//Customer/@ContactName', test_xml.data)))
FROM test_xml