improved XML parsing

For consistency and easier navigation, all nodes have "name", "attrs",
"content" and "items" elements. "attrs" and "items" are always
lists and may be empty. Content is #f if empty.