add fromString() method to Document class