Get source location also for some processed DOM fragments
Minor fixups
Allow selection of package spec with "when" attribute on spec