Im looking for something like this.
String mainActivityLayoutAsString = ReadResourceAsString(R.layout.activity_main)
Simple!
No. The layout files aren't kept as raw XML. They're preprocessed to a form easier to parse at runtime.
raw resources ...as the name might already suggest.