SQLServer has a very useful function called OPENXML. It works is used like this:
DECLARE @idoc int DECLARE @doc varchar(1000) SET @doc =\'
This is currently not possible in PostgreSQL (unless someone has written awesome code that he didn't tell anyone about until now).