title: Converting text column to xml column in postgres
body: <p>My problem is this:</p>
  
  <p>I use a software (geonetwork - <a href="http://geonetwork-opensource.org/" rel="nofollow">http://geonetwork-opensource.org/</a>) that populates a postgres database with plenty of tables. One of those tables is the "data" table that stores plenty of interesting xml files (each row in the table contains the information of a single and complete xml file with all the right syntax).</p>
  
  <p>Unfortunately, geonetwork creates this column using the type "text" instead of "xml", now I want to create a view that converts the xml information that is stored as text in that column to an xml column, so I can go through the information within the xml, that is not really accessible when stored as a text.</p>
  
  <p>But how do I do that?</p>
  
  <p>I found this in the documentation, but no good example of how to actually do the trick.</p>
  
  <p><a href="https://www.postgresql.org/docs/9.3/static/datatype-xml.html" rel="nofollow">https://www.postgresql.org/docs/9.3/static/datatype-xml.html</a>
  <a href="https://www.postgresql.org/docs/9.3/static/sql-createview.html" rel="nofollow">https://www.postgresql.org/docs/9.3/static/sql-createview.html</a></p>
  
  <p>Any help is appreciated.</p>