You should have the code of "getDomFromString" inline in this method.