Fixes #5065: create a generic method to add line in xml section

I believe that in XML the correct term is "tag". Am I mistaken? I had never heard of a section for an XML file, anyway.