We now rely on libxml api instead of cut/paste.

If accepted, please credit Damien Sandras from Be IP s.a. @ http://www.beip.be