Use ast to generate parsed document