it says that you have something of type a1 , and its value is xx and it contains two things of type b2 with values zz and yy.
I don't speak Czec language and I don't know the context of your work so I'm going to struggle to help you...
Here is a more detaled example of the type of manipulations are possible, but you will have to bring your own knowledge of the xml structure and domain expertise to bear
library(tidyverse)
tf <- tempfile()
writeLines(gsub("[[:space:]]", "",
"<inventory>
<car>Saloon
<workingwheels>2<position>front</position></workingwheels>
<workingwheels>2<position>rear</position></workingwheels>
<enginedisplacement_Litres>3000</enginedisplacement_Litres>
</car>
<car>Trike
<workingwheels>1<position>front</position></workingwheels>
<workingwheels>2<position>rear</position></workingwheels>
<enginedisplacement_Litres>500</enginedisplacement_Litres>
</car>
</inventory>"), con = tf)
readLines(tf)
(d1 <- flatxml::fxml_importXMLFlat(tf) %>% tibble())
# using knowledge of expected structure to condense the info
# we want 1 row per car ultimately
#identify cars
d1$carcount <- cumsum(ifelse(d1$elem.=="car",1,0))
d1
(d2 <- d1 %>% filter(carcount>0) %>% group_by(carcount) %>%
summarise(car = max(if_else(elem.=="car",value.,NA_character_),na.rm=TRUE),
engdisp = max(if_else(level3=="enginedisplacement_Litres",as.numeric(value.),-Inf),na.rm=TRUE),
wheelspos = list(if_else(level3=="workingwheels"& level4=="position",value.,NA_character_) %>% na.omit),
wheelsnum = list(if_else(level3=="workingwheels"& is.na(level4),as.numeric(value.),NA_real_) %>% na.omit)))
(d3 <- unnest(d2,
cols=c(wheelspos,wheelsnum)))
# now we have 2 row per car
# final adjustment
(d4 <- group_by(d3,carcount) %>%
summarise(car = max(car,na.rm=TRUE),
engdisp = max(engdisp,na.rm=TRUE),
front_wheel_num = max(if_else(wheelspos=="front",wheelsnum,-Inf)),
rear_wheel_num = max(if_else(wheelspos=="rear",wheelsnum,-Inf))
))
# A tibble: 2 x 5
# carcount car engdisp front_wheel_num rear_wheel_num
# <dbl> <chr> <dbl> <dbl> <dbl>
# 1 Saloon 3000 2 2
# 2 Trike 500 1 2