Adaptive Markup Language Generation for Contextually-Grounded Visual Document Understanding