Recognition and Completion of Incomplete XML Documents