feat(xmlTree): add ability to write to string, stream and writer

related to #CAM-2289