In my case, I wrap the inner of quick_xml::Writer<W> into another struct that implements std::io::Write.
So I end up with quick_xml::Writer<my::Writer<W>>.
Currently, it's possible to retrieve the &mut W via .inner(), but not &W.
An example of such a method in the Rust Standard Library: std::io::BufWriter.