halfway converted to ET for XML parsing

wish I didn’t need the funny conditionals for plurality, but good for
now. Just need to do pkg-nested-in-smartgroup and
pkg+smartgroup-nested-in-policy and I’m fully off of regexes!