I would recommend checking out the SourceEditing Unit Tests for seeing how to create a StructuredDocument without loading a file.
Thanks!