I don’t think you want to use show_source aka. highlight_file. Though it may display as XML, it does not return XML. It returns some characters converted to entities. eg < instead of <
If splitting into an array won’t work for you, you should be able to use “reader” and “writer” as long as you are working with valid non-entitized XML.