Added method to write a StyledDocument with Filesystem API.