Use Nokogiri and xmlsec for build/sign/encrypt.