Idea would be to build a light AST as a first pass, then have the unmarshaler and Document parser do what they need with it.