Hand-migration to TypedXml interface.

Previous changes have applied mechanical refactorings, but this change
hand-migrates the remaining logic which was too complex to identify.

This change should have no behavior change; famous last words.

Bug: 171832118
Test: manual
Change-Id: I73f63cdb84d27e87c2af5a36d043cc225f1c749c
8 files changed