XmlExtractKit exposes two main output styles.
prettyPrint(): readable outputBest when you want to move XML data into ordinary application code quickly.
[
'offer' => [
'@attributes' => [
'id' => '206111',
'available' => 'true',
],
'name' => 'USB-C Dock',
'price' => [
'@value' => '129.90',
'@attributes' => [
'currency' => 'USD',
],
],
'picture' => [
'https://cdn.example.test/1.jpg',
'https://cdn.example.test/2.jpg',
],
],
]
@value when attributes are present;@attributes.convert(): normalized hierarchyBest when you want a predictable structure for traversal, wrappers, or internal adapters.
XmlElement;XmlConverter or XmlParser.[
'n' => 'feed',
'a' => [
'generated_at' => '2026-03-28T09:00:00Z',
],
's' => [
[
'n' => 'offer',
'a' => [
'id' => '206111',
'available' => 'true',
],
's' => [
[
'n' => 'name',
'v' => 'USB-C Dock',
],
[
'n' => 'price',
'v' => '129.90',
'a' => [
'currency' => 'USD',
],
],
],
],
],
]
n = element name;v = direct text value;a = attributes;s = child sequence;