I think the method "getDomFromString" is useless because you should call "getDomFromString" only on an a valid string document. So, only the string document setting by "setStringDocument". You must not use "getDomFromString" with an other string document.