initial functional port to pretty-xml