Minor fixups: extract addAttributeToList() + no reason to first check the attributeValue to ignore namespace declarations