Is there a way to do this from the XML?
No, sorry. You can only specify the built-in typefaces through XML.
Is there a way to do it from code in one place, to say that the whole application and all the components should use the custom typeface instead of the default one?
Not that I am aware of.
There are a variety of options for these nowadays:
Font resources and backports in the Android SDK, if you are using appcompat
Third-party libraries for those not using appcompat
, though not all will support defining the font in layout resources