Additional 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
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: If2d4b1a354481a83edb4bbcfa22f690b7f5e97c3
17 files changed