Add optional methods in xmlwriter that takes dstring instead