use BytesIO for XML as XML is a stream of Bytes