Primo: make data extraction slightly more general

Now tested locally. Also added some comments etc.
I don't think that the xml-node `display` can have a child `display` again.