python create a script that looks through weapons.meta files that are within folders in a base folder the open the weapons.meta and find the text WEAPON_ and append the WEAPON_name to a txt document

here is a an example of what the weapons.meta file looks like

<?xml version="1.0" encoding="UTF-8"?>
<CWeaponInfoBlob>
    <SlotNavigateOrder>
        <Item>
            <WeaponSlots>
                <Item>
                    <OrderNumber value="180" />
                    <Entry>SLOT_AK971</Entry>
                </Item>
            </WeaponSlots>
        </Item>
        <Item>
            <WeaponSlots>
                <Item>
                    <OrderNumber value="190" />
                    <Entry>SLOT_AK971</Entry>
                </Item>
            </WeaponSlots>
        </Item>
    </SlotNavigateOrder>
    <SlotBestOrder>
        <WeaponSlots>
            <Item>
                <OrderNumber value="60" />
                <Entry>SLOT_AK971</Entry>
            </Item>
        </WeaponSlots>
    </SlotBestOrder>
    <TintSpecValues />
    <FiringPatternAliases />
    <UpperBodyFixupExpressionData />
    <AimingInfos />
    <Infos>
        <Item>
            <Infos>
                <Item type="CWeaponInfo">
          <Name>WEAPON_AK971</Name>
          <Model>W_AR_AK971</Model>
          <Audio>AUDIO_ITEM_ASSAULTRIFLE</Audio>
          <Slot>SLOT_AK971</Slot>
          <DamageType>BULLET</DamageType>
          <Explosion>
            <Default>DONTCARE</Default>
            <HitCar>DONTCARE</HitCar>
            <HitTruck>DONTCARE</HitTruck>
            <HitBike>DONTCARE</HitBike>
            <HitBoat>DONTCARE</HitBoat>
            <HitPlane>DONTCARE</HitPlane>
          </Explosion>
          <FireType>INSTANT_HIT</FireType>
          <WheelSlot>WHEEL_RIFLE</WheelSlot>
          <Group>GROUP_RIFLE</Group>
          <AmmoInfo ref="AMMO_RIFLE" />
          <AimingInfo ref="RIFLE_LO_BASE_STRAFE" />
          <ClipSize value="30" />
          <AccuracySpread value="3.000000" />
          <AccurateModeAccuracyModifier value="0.500000" />
          <RunAndGunAccuracyModifier value="2.000000" />
          <RunAndGunAccuracyMaxModifier value="1.000000" />
          <RecoilAccuracyMax value="0.500000" />
          <RecoilErrorTime value="3.000000" />
          <RecoilRecoveryRate value="1.000000" />
          <RecoilAccuracyToAllowHeadShotAI value="1000.000000" />
          <MinHeadShotDistanceAI value="1000.000000" />
          <MaxHeadShotDistanceAI value="1000.000000" />
          <HeadShotDamageModifierAI value="1000.000000" />
          <RecoilAccuracyToAllowHeadShotPlayer value="0.175000" />
          <MinHeadShotDistancePlayer value="5.000000" />
          <MaxHeadShotDistancePlayer value="40.000000" />
          <HeadShotDamageModifierPlayer value="1.500000" />
          <Damage value="32.000000" />
          <DamageTime value="0.000000" />
          <DamageTimeInVehicle value="0.000000" />
          <DamageTimeInVehicleHeadShot value="0.000000" />
          <HitLimbsDamageModifier value="0.500000" />
          <NetworkHitLimbsDamageModifier value="0.800000" />
          <LightlyArmouredDamageModifier value="0.750000" />
          <Force value="75.000000" />
          <ForceHitPed value="140.000000" />
          <ForceHitVehicle value="1200.000000" />
          <ForceHitFlyingHeli value="1250.000000" />
          <OverrideForces>
            <Item>
              <BoneTag>BONETAG_HEAD</BoneTag>
              <ForceFront value="80.000000" />
              <ForceBack value="50.000000" />
            </Item>
            <Item>
              <BoneTag>BONETAG_NECK</BoneTag>
              <ForceFront value="60.000000" />
              <ForceBack value="90.000000" />
            </Item>
            <Item>
              <BoneTag>BONETAG_L_THIGH</BoneTag>
              <ForceFront value="40.000000" />
              <ForceBack value="1.000000" />
            </Item>
            <Item>
              <BoneTag>BONETAG_R_THIGH</BoneTag>
              <ForceFront value="40.000000" />
              <ForceBack value="1.000000" />
            </Item>
            <Item>
              <BoneTag>BONETAG_L_CALF</BoneTag>
              <ForceFront value="70.000000" />
              <ForceBack value="80.000000" />
            </Item>
            <Item>
              <BoneTag>BONETAG_R_CALF</BoneTag>
              <ForceFront value="60.000000" />
              <ForceBack value="100.000000" />
            </Item>
          </OverrideForces>
          <ForceMaxStrengthMult value="1.000000" />
          <ForceFalloffRangeStart value="0.000000" />
          <ForceFalloffRangeEnd value="50.000000" />
          <ForceFalloffMin value="1.000000" />
          <ProjectileForce value="0.000000" />
          <FragImpulse value="600.000000" />
          <Penetration value="0.100000" />
          <VerticalLaunchAdjustment value="0.000000" />
          <DropForwardVelocity value="0.000000" />
          <Speed value="2000.000000" />
          <BulletsInBatch value="1" />
          <BatchSpread value="0.000000" />
          <ReloadTimeMP value="-1.000000" />
          <ReloadTimeSP value="-1.000000" />
          <VehicleReloadTime value="1.000000" />
          <AnimReloadRate value="0.900000" />
          <BulletsPerAnimLoop value="1" />
          <TimeBetweenShots value="0.139000" />
          <TimeLeftBetweenShotsWhereShouldFireIsCached value="-1.000000" />
          <SpinUpTime value="0.000000" />
          <SpinTime value="0.000000" />
          <SpinDownTime value="0.000000" />
          <AlternateWaitTime value="-1.000000" />
          <BulletBendingNearRadius value="0.000000" />
          <BulletBendingFarRadius value="0.750000" />
          <BulletBendingZoomedRadius value="0.375000" />
		      <FirstPersonBulletBendingNearRadius value="0.000000" />
          <FirstPersonBulletBendingFarRadius value="0.750000" />
          <FirstPersonBulletBendingZoomedRadius value="0.375000" />
          <Fx>
               <EffectGroup>WEAPON_EFFECT_GROUP_RIFLE_ASSAULT</EffectGroup>
               <FlashFx>muz_assault_rifle</FlashFx>
               <FlashFxAlt>muz_alternate_star</FlashFxAlt>
   			   <FlashFxFP>muz_assault_rifle_fp</FlashFxFP>
               <FlashFxAltFP />
               <MuzzleSmokeFx>muz_smoking_barrel</MuzzleSmokeFx>
   			   <MuzzleSmokeFxFP>muz_smoking_barrel_fp</MuzzleSmokeFxFP>
               <MuzzleSmokeFxMinLevel value="0.300000" />
               <MuzzleSmokeFxIncPerShot value="0.100000" />
               <MuzzleSmokeFxDecPerSec value="0.250000" />
               <ShellFx>eject_auto</ShellFx>
   			   <ShellFxFP>eject_auto_fp</ShellFxFP>
               <TracerFx>bullet_tracer</TracerFx>
               <PedDamageHash>BulletLarge</PedDamageHash>
               <TracerFxChanceSP value="0.150000" />
               <TracerFxChanceMP value="0.750000" />
               <FlashFxChanceSP value="1.000000" />
               <FlashFxChanceMP value="1.000000" />
               <FlashFxAltChance value="0.200000" />
               <FlashFxScale value="1.000000" />
               <FlashFxLightEnabled value="true" />
               <FlashFxLightCastsShadows value="false" />
               <FlashFxLightOffsetDist value="0.000000" />
               <FlashFxLightRGBAMin x="255.000000" y="93.000000" z="25.000000" />
               <FlashFxLightRGBAMax x="255.000000" y="100.000000" z="50.000000" />
               <FlashFxLightIntensityMinMax x="1.000000" y="2.000000" />
               <FlashFxLightRangeMinMax x="2.500000" y="3.500000" />
               <FlashFxLightFalloffMinMax x="1024.000000" y="1536.000000" />
               <GroundDisturbFxEnabled value="false" />
               <GroundDisturbFxDist value="5.000000" />
               <GroundDisturbFxNameDefault />
               <GroundDisturbFxNameSand />
               <GroundDisturbFxNameDirt />
               <GroundDisturbFxNameWater />
               <GroundDisturbFxNameFoliage />
          </Fx>
          <InitialRumbleDuration value="90" />
          <InitialRumbleIntensity value="0.700000" />
          <InitialRumbleIntensityTrigger value="0.950000" />
          <RumbleDuration value="90" />
          <RumbleIntensity value="0.100000" />
          <RumbleIntensityTrigger value="0.800000" />
          <RumbleDamageIntensity value="1.000000" />
	      <InitialRumbleDurationFps value="150" />
          <InitialRumbleIntensityFps value="1.000000" />
          <RumbleDurationFps value="95" />
          <RumbleIntensityFps value="1.000000" />
          <NetworkPlayerDamageModifier value="1.000000" />
          <NetworkPedDamageModifier value="1.000000" />
          <NetworkHeadShotPlayerDamageModifier value="1.700000" />
          <LockOnRange value="65.000000" />
          <WeaponRange value="200.000000" />
          <BulletDirectionOffsetInDegrees value="0.000000" />
          <AiSoundRange value="-1.000000" />
          <AiPotentialBlastEventRange value="-1.000000" />
          <DamageFallOffRangeMin value="49.500000" />
          <DamageFallOffRangeMax value="200.000000" />
          <DamageFallOffModifier value="0.300000" />
          <VehicleWeaponHash />
          <DefaultCameraHash>DEFAULT_THIRD_PERSON_PED_AIM_CAMERA</DefaultCameraHash>
          <CoverCameraHash>DEFAULT_THIRD_PERSON_PED_AIM_IN_COVER_CAMERA</CoverCameraHash>
          <CoverReadyToFireCameraHash />
          <RunAndGunCameraHash>DEFAULT_THIRD_PERSON_PED_RUN_AND_GUN_CAMERA</RunAndGunCameraHash>
          <CinematicShootingCameraHash>DEFAULT_THIRD_PERSON_PED_CINEMATIC_SHOOTING_CAMERA</CinematicShootingCameraHash>
          <AlternativeOrScopedCameraHash />
          <RunAndGunAlternativeOrScopedCameraHash />
          <CinematicShootingAlternativeOrScopedCameraHash />
          <CameraFov value="35.000000" />
          <FirstPersonScopeFov value="20.00000"/>
          <FirstPersonScopeAttachmentFov value="20.00000"/>
          <FirstPersonRNGOffset x="0.000000" y="0.000000" z="0.000000" />
          <FirstPersonRNGRotationOffset x="0.000000" y="0.000000" z="0.000000" />
          <FirstPersonLTOffset x="0.000000" y="0.000000" z="0.000000" />
          <FirstPersonLTRotationOffset x="0.000000" y="0.000000" z="0.000000" />
          <FirstPersonScopeOffset x="0.00000" y="-0.0200" z="-0.0230" />
          <FirstPersonScopeAttachmentOffset x="0.00000" y="0.0000" z="-0.0280" />
          <FirstPersonScopeRotationOffset x="-0.70000" y="0.0000" z="0.0000" />
          <FirstPersonScopeAttachmentRotationOffset x="0.00000" y="0.0000" z="0.0000" />
          <FirstPersonAsThirdPersonIdleOffset x="-0.07500000" y="0.000000" z="-0.05" />
          <FirstPersonAsThirdPersonRNGOffset x="-0.025000" y="0.000000" z="-0.075000" />
          <FirstPersonAsThirdPersonLTOffset x="0.025000" y="0.000000" z="-0.0750000" />
          <FirstPersonAsThirdPersonScopeOffset x="0.075000" y="-0.050000" z="-0.060000" />
          <FirstPersonAsThirdPersonWeaponBlockedOffset x="-0.1000000" y="0.000000" z="-0.100000" />
          <FirstPersonDofSubjectMagnificationPowerFactorNear value="1.025000" />
          <FirstPersonDofMaxNearInFocusDistance value="0.000000" />
          <FirstPersonDofMaxNearInFocusDistanceBlendLevel value="0.300000" />
          <ZoomFactorForAccurateMode value="1.300000" />
          <RecoilShakeHash>ASSAULT_RIFLE_RECOIL_SHAKE</RecoilShakeHash>
          <RecoilShakeHashFirstPerson>FPS_ASSAULT_RIFLE_RECOIL_SHAKE</RecoilShakeHashFirstPerson>
          <AccuracyOffsetShakeHash>DEFAULT_THIRD_PERSON_ACCURACY_OFFSET_SHAKE</AccuracyOffsetShakeHash>
          <MinTimeBetweenRecoilShakes value="100" />
          <RecoilShakeAmplitude value="0.333000" />
          <ExplosionShakeAmplitude value="-1.000000" />
          <ReticuleHudPosition x="0.000000" y="0.000000" />
          <AimOffsetMin x="0.250000" y="0.200000" z="0.600000" />
          <AimProbeLengthMin value="0.430000" />
          <AimOffsetMax x="0.165000" y="-0.180000" z="0.470000" />
          <AimProbeLengthMax value="0.340000" />
  	      <AimOffsetMinFPSIdle x="0.162000" y="0.225000" z="0.052000" />
		     <AimOffsetMedFPSIdle x="0.187000" y="0.197000" z="0.321000" />
		     <AimOffsetMaxFPSIdle x="0.155000" y="0.038000" z="0.364000" />
	      <AimOffsetEndPosMinFPSIdle x="-0.284000" y="0.612000" z="-0.205000" />
   		  <AimOffsetEndPosMedFPSIdle x="-0.178000" y="0.639000" z="0.616000" />
   		  <AimOffsetEndPosMaxFPSIdle x="-0.21700" y="-0.096000" z="0.887000" />
   		  <AimOffsetMinFPSLT x="0.180000" y="0.231000" z="0.669000" />
   		  <AimOffsetMaxFPSLT x="0.048000" y="-0.225000" z="0.409000" />
   		  <AimOffsetMinFPSRNG x="0.120000" y="0.275000" z="0.509000" />
   		  <AimOffsetMaxFPSRNG x="0.138000" y="-0.212000" z="0.518000" />
   		  <AimOffsetMinFPSScope x="0.090000" y="0.078000" z="0.531000" />
   		  <AimOffsetMaxFPSScope x="0.006000" y="-0.059000" z="0.694000" />
          <TorsoAimOffset x="-1.000000" y="0.550000" />
          <TorsoCrouchedAimOffset x="0.100000" y="0.120000" />
          <LeftHandIkOffset x="0.015000" y="0.095000" z="-0.008000" />
          <ReticuleMinSizeStanding value="0.600000" />
          <ReticuleMinSizeCrouched value="0.500000" />
          <ReticuleScale value="0.300000" />
          <ReticuleStyleHash>WEAPONTYPE_RIFLE</ReticuleStyleHash>
          <FirstPersonReticuleStyleHash />
          <PickupHash>PICKUP_WEAPON_AK971</PickupHash>
          <MPPickupHash>PICKUP_AMMO_BULLET_MP</MPPickupHash>
          <HumanNameHash>WT_AK971</HumanNameHash>
          <MovementModeConditionalIdle>MMI_2Handed</MovementModeConditionalIdle>
          <StatName>AK971</StatName>
          <KnockdownCount value="-1" />
          <KillshotImpulseScale value="1.000000" />
          <NmShotTuningSet>Automatic</NmShotTuningSet>
          <AttachPoints>
            <Item>
              <AttachBone>WAPClip</AttachBone>
              <Components>
                <Item>
                  <Name>COMPONENT_AK971_CLIP_01</Name>
                  <Default value="true" />
                </Item>
              </Components>
            </Item>
          </AttachPoints>
          <GunFeedBone />
          <TargetSequenceGroup />
          <WeaponFlags>CarriedInHand Gun CanLockonOnFoot CanLockonInVehicle CanFreeAim TwoHanded AnimReload AnimCrouchFire UsableOnFoot UsableInCover AllowEarlyExitFromFireAnimAfterBulletFired NoLeftHandIKWhenBlocked HasLowCoverReloads HasLowCoverSwaps LongWeapon UseFPSAimIK UseFPSSecondaryMotion OnlyFireOneShotPerTriggerPress</WeaponFlags>
          <TintSpecValues ref="TINT_DEFAULT" />
          <FiringPatternAliases ref="FIRING_PATTERN_RIFLE" />
          <ReloadUpperBodyFixupExpressionData ref="default" />
          <AmmoDiminishingRate value="3" />
          <AimingBreathingAdditiveWeight value="1.000000" />
          <FiringBreathingAdditiveWeight value="1.000000" />
          <StealthAimingBreathingAdditiveWeight value="1.000000" />
          <StealthFiringBreathingAdditiveWeight value="1.000000" />
          <AimingLeanAdditiveWeight value="1.000000" />
          <FiringLeanAdditiveWeight value="1.000000" />
          <StealthAimingLeanAdditiveWeight value="1.000000" />
          <StealthFiringLeanAdditiveWeight value="1.000000" />
          <ExpandPedCapsuleRadius value="0.000000" />
          <AudioCollisionHash />
          <HudDamage value="32" />
          <HudSpeed value="65" />
          <HudCapacity value="40" />
          <HudAccuracy value="55" />
          <HudRange value="45" />
        </Item>
            </Infos>
        </Item>
        <Item>
            <Infos />
        </Item>
        <Item>
            <Infos />
        </Item>
    </Infos>
    <VehicleWeaponInfos />
    <Name>AK971</Name>
</CWeaponInfoBlob>

In this example I was want it to return and add
WEAPON_AK971 to the txt document