public string GetLoadedDocument() { if (document == null) throw new Exception ("The document has already been retrieved"); //TODO: substitute all components string doc = document; document = null; return doc; }