diff -u b/src/Plugin/migrate_plus/data_parser/Xml.php b/src/Plugin/migrate_plus/data_parser/Xml.php --- b/src/Plugin/migrate_plus/data_parser/Xml.php +++ b/src/Plugin/migrate_plus/data_parser/Xml.php @@ -239,19 +239,19 @@ $values = $target_element->xpath($xpath); } foreach ($values as $value) { - // If the SimpleXMLElement doesn't render to a string of any sort - // and has children, then return it in XML text for the process + // If the SimpleXMLElement doesn't render to a string of any sort, + // and has children then return the whole object for the process // plugin or other row manipulation. if ($value->children() && !trim((string) $value)) { - /** @var \SimpleXMLElement $value */ - $this->currentItem[$field_name][] = $value->asXML(); + $this->currentItem[$field_name] = $value; } else { $this->currentItem[$field_name][] = (string) $value; // and has children then return the whole object for the process // plugin or other row manipulation. if ($value->children() && !trim((string) $value)) { - $this->currentItem[$field_name] = $value; + /** @var \SimpleXMLElement $value */ + $this->currentItem[$field_name][] = $value->asXML(); } else { $this->currentItem[$field_name][] = (string) $value; only in patch2: unchanged: --- a/src/Plugin/migrate_plus/data_parser/SimpleXml.php +++ b/src/Plugin/migrate_plus/data_parser/SimpleXml.php @@ -68,7 +68,8 @@ class SimpleXml extends DataParserPluginBase { foreach ($this->fieldSelectors() as $field_name => $xpath) { foreach ($target_element->xpath($xpath) as $value) { if ($value->children() && !trim((string) $value)) { - $this->currentItem[$field_name] = $value; + /** @var \SimpleXMLElement $value */ + $this->currentItem[$field_name][] = $value->asXML(); } else { $this->currentItem[$field_name][] = (string) $value;