First I search for xml_node node = xml->document().first_element_by_attribute("package", "id", m_selection);
So I get the child with name "name" (and others if there would be some).
Why the heck does this child not have value Basic now? I realized that I have to use child(0) from this child, but I am still confused that PCDATA is again a child itself and not the value of this first child. Since attribute-values have to be retrieved through attribute("foo") there would have been no problem to use value for the child itself...
Anyhow, as I said I love PugXML, if there would be a STL-style-updated documentation for it. Without something like this looks unusual.
Yes I agree that this is quite confusing. From memory there are cases where the PCDATA/CDATA isn't at child which is why I added xml_node::child_value(), xml_node::find_child() etc. This also explains why the PCDATA/CDATA can't be the nodes value.
It is possible that refactoring the code could improve areas like this, but I've just learnt to live with it.