There are no CDATA chunks in the main.xml layout example and by default it is unlikely that the Binary XML version of any layout will contain any unless you go out of your way to do something like this.
The bytes in blue are the chunk header and those in green the chunk body.
The chunk header is an instance of struct ResXMLTree_node.
The header.type field is 0x0104 (RES_XML_CDATA_TYPE).
// The raw CDATA character data.
// The typed value of the character data if this is a CDATA node.
The data field specifies the raw character data as in index into the StringPool chunk of the containing XML chunk.
The typedData field specifies the value of the character data contained in this chunk.
It is not clear in what circumstances this field is going to contain an actual value and how that value is derived from the character data and there are no clues in the source code.
00000040 0c 0c 6c 61 //  "layout_width"
0000004c 74 68 00 0d //  "layout_height"
0000005c 68 74 00 07 //  "android"
00000068 00 2a 2a 68 //  "http://schemas.android.com/apk/res/android"
00000094 64 00 00 00 //  ""
00000098 00 0c 0c 4c //  "LinearLayout"
The bytes in blue are the chunk headers and those in green the chunk bodies.
The header.type field is 0x0103 (RES_XML_END_ELEMENT_TYPE).
// String of the full namespace of this element.
// character data if this is a CDATA node.
The ns specifies the namespace name (the Namespace URI) of this element as an index into the StringPool of the containing XML chunk.
If the element has no namespace name the value of this field is -1 (0xFFFFFFFF).
The name field specifies the local name of the element as an index into the StringPool of the containing XML chunk.
This is an annotated version of the EndElement chunk which represents the end tag of the LinearLayout element in the example.
The chunk body comprises an instance of the C++ struct ResXMLTree_attrExt followed by zero or more Attributes.
// Byte offset from the start of this structure where the attributes start.
// Size of the ResXMLTree_attribute structures that follow.
// immediately following this node.
// Index (1-based) of the "id" attribute. 0 if none.
// Index (1-based) of the "class" attribute. 0 if none.
// Index (1-based) of the "style" attribute. 0 if none.
If the element has no namespace name the value of this field is -1.
The name field specifies the local name of this element as an index into the StringPool of the containing XML chunk.
The attributeStart field specifies the start of the attribute data within the chunk body as an offset from the start of the chunk body.
Since this structure is at the start of the chunk body and is of fixed-size the value of this field is fixed at 20 (0x0014).
The attributeSize field specifies the size in bytes of the structure used to represent an Attribute.
This value is fixed and coincidentally is the same as that of the attributeStart field preceding it, that is, 20 (0x0014).
The attributeCount field specifies the number of Attributes that follow.
The idIndex field specifies the Attribute if any which represents the id attribute in the original XML.
The classIndex field specifies the Attribute if any which represents the class attribute in the original XML.
The styleIndex field specifies the Attribute if any which represents the style attribute in the original XML.
// Namespace of this attribute.
// Name of this attribute.
// The original raw string value of this attribute.
// Processesd typed value of this attribute.
The ns field specifies namespace name (the Namespace URI) of the attribute as an index into the StringPool of the containing XML chunk.
The name field specifies the local name of this Attribute as an index into the StringPool of the containing XML chunk.
Note that the value of this field also functions as an index into the Resource Id array of the XMLResourceMap chunk if it is present.
The rawValue field specifies the value of this Attribute as it appeared in the original XML as an index into the StringPool of the containing XML chunk.
If the original value is not available it has the value -1.
The typedValue is an instance of struct Res_value which specifies the value of the Attribute.
This is an annotated version of the StartElement chunk which represents the start tag of the LinearLayout element in the example.
The Start Namespace chunk starts at 00001a4 and the End Namespace chunk at 00002ac.
Start and end namespace chunks represent the scope of a namespace declaration which occurs in the start tag of an element.
If there are multiple declarations in the same start tag then the start namespace chunks for the namespaces appear in the order of the declarations and the end namespace chunks in reverse order.
The chunks which represent the start and end of namespace scopes have the same structure.
The chunk header is an instance of the struct ResXMLTree_node.
0x0101 (RES_XML_END_NAMESPACE_TYPE) if the chunk represents the end of a Namespace.
The header.headerSize is always 16 (0x0010).
The header.size is always 24 (0x0018).
// The prefix of the namespace.
// The URI of the namespace.
The prefix field specifies the XML Namespace prefix as an index into the StringPool of the containing XML chunk.
The uri field specifies the XML Namespace URI as an index into the StringPool of the containing XML chunk.
This is an annotated version of the Start Namespace chunk from the example.
This is an annotated version of the End Namespace chunk from the example.
The example contains a single XMLResourceMap chunk.
The chunk header is an instance of struct ResChunk_header.
The header.type field is 0x0180 (RES_XML_RESOURCE_MAP_TYPE).
The chunk body is an array of Resource Ids.
The element at index i is the Resource Id of the Attribute named by the string at index i in the StringPool chunk of the containing XML chunk.
This is an annotated version of the XMLResourceMap chunk from the example.
in the android package are indeed those specified in the chunk body.
// Line number in original source file at which this element appeared.
// Optional XML comment that was associated with this element; -1 if none.
The example contains a single XML chunk which represents the original XML document.
The bytes in blue are the chunk header and those in green, that is everything else, the chunk body.
which is simply a struct ResChunk_header.
The header.type is always 0x0003 (RES_XML_TYPE).
This is an annotated version of the chunk header and the following StringPool chunk from the example.
0000004c 0b 00 6f 00 //  "orientation"
00000064 00 00 0c 00 //  "layout_width"
00000080 00 00 0d 00 //  "layout_height"
000000a0 04 00 74 00 //  "text"
000000ac 07 00 61 00 //  "android"
000000bc 00 00 2a 00 //  "http://schemas.android.com/apk/res/android"
00000114 00 00 00 00 //  ""
00000118 00 00 0c 00 //  "LinearLayout"
00000134 00 00 08 00 //  "TextView"
00000148 00 00 1e 00 //  "Hello World, PendragonActivity"
The examples which follow are taken from the binary XML version of the main.xml layout file that was automatically generated as part of the same project the Resource table example was taken from.
The contents of the generated main.xml layout file.
The result of running hexdump on the binary version main.xml layout file extracted from the application .apk file.
Every Android application defines a set of Resources.
These Resources are stored in a Resource Table, or in some cases, for example, layouts, as Android specific Binary XML, which is referenced from the Resource Table.
An application’s Resource Table is stored persistently in the application’s .apk file in the resources.arsc file. Binary XML data is also stored in files in the .apk.
The Resource Table and associated Binary XML data is represented both at runtime and when stored in files by Chunks.
As a consequence an application’s Resources can be loaded by simply mapping the files that contain them into memory.
A Chunk is just a piece of memory split into two parts, a header and a body. The exact structure of the header and the body of a given Chunk is determined by its type.
// pool back to resource identifiers.  It is optional.
// on the containing chunk.
// no data associated with the chunk.
without knowing anything further about the structure of the given Chunk.
By default the data in Chunks is in little-endian byte order both at runtime and when stored in files.