Totalling by key and numerical value

Task

Source document

<items>
  <item width="25" unit="px" />
  <item width="50" unit="px" />
  <item width="65" unit="px" />
  <item width="100" unit="px" />
  <item width="15" unit="pt" />
  <item width="40" unit="%" />
  <item width="25" unit="px" />
</items>

Challenge

Add up all width-properties of the item-elements that are specified in “px” and do not exceed the value of 70

Desired selection (text output)

165

Exercise

Your input

Eine Lösung wäre: Lösung