title: how to parse an xml string in postgres
body: <p>in ms sql I have the following code:</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[xmlDictamen_Alta]
    @Xml text
  as begin
  
  declare @Id            integer
  declare @DictamenId    numeric(18,0)
  declare @DocumentoId   numeric(18,0)
  declare @Descripcion   varchar(300)
  
  begin
  
      set nocount on
      exec dbo.sp_xml_preparedocument @Id output, @Xml
  
      select 
          @DocumentId  = DocumentId,
          @Description = IsNull( Description, ''),
      from 
      OpenXml( @IdXml, '/Parameter', 2) with (
      DocumentId       numeric(18,0),
      Description      varchar(300)
      )
  
      exec dbo.sp_xml_removedocument @IdXml
  
  
  /*
  execute xmlDictamen_Alta
  '
      &lt;Parameter&gt;
        &lt;DocumentId&gt;1328&lt;/DocumentId&gt;
        &lt;Description&gt;Descripcion&lt;/Description&gt;
      &lt;/Parameter&gt;
  '
  */
  </code></pre>
  
  <p>How would you port these stored procedure to postgres???</p>