diff --git a/src/Plugin/migrate_plus/data_parser/Xml.php b/src/Plugin/migrate_plus/data_parser/Xml.php index 8235e3f2a8d3e59b0a7e1dc29bafa09e515c90a3..0213a0f7bb4df3454ff0d88de44168569a883ae6 100644 --- a/src/Plugin/migrate_plus/data_parser/Xml.php +++ b/src/Plugin/migrate_plus/data_parser/Xml.php @@ -239,7 +239,15 @@ class Xml extends DataParserPluginBase { $values = $target_element->xpath($xpath); } foreach ($values as $value) { - $this->currentItem[$field_name][] = (string) $value; + // 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)) { + $this->currentItem[$field_name] = $value; + } + else { + $this->currentItem[$field_name][] = (string) $value; + } } } // Reduce single-value results to scalars.