title: I have to modify a xml file and i am using xml e tree
body: <p>I have got a very big xml document and i have to modify the value of 2 tags there.</p>
  <pre><code>                &lt;/Hours&gt;
                  &lt;IsBusyHourSet&gt;true&lt;/IsBusyHourSet&gt;
                  &lt;BusyHour&gt;-1&lt;/BusyHour&gt;
                  &lt;DayOfWeek&gt;
                    &lt;Day&gt;0&lt;/Day&gt;
                  &lt;/DayOfWeek&gt;
                &lt;/DayDetails&gt;
              &lt;/DayDetailsList&gt;
              &lt;DayHourType&gt;Specified&lt;/DayHourType&gt;
              &lt;IsUsingAllDaysAndHours&gt;true&lt;/IsUsingAllDaysAndHours&gt;
            &lt;/DayHourSettings&gt;
          &lt;/Value&gt;
        &lt;/AnalysisParameter&gt;
        &lt;AnalysisParameter Id=&quot;f7c95&quot; IsPrivate=&quot;false&quot; IsReadOnly=&quot;false&quot; IsDeletable=&quot;true&quot; PromptOnTemplate=&quot;false&quot; IsPartitionable=&quot;false&quot;&gt;
          &lt;Name&gt;Time&lt;/Name&gt;
          &lt;Description&gt;hourly&lt;/Description&gt;
          &lt;CsvInputReferenceName /&gt;
          &lt;Value Type=&quot;Resources.Utilities.DefaultTimePeriod, Wpf.Resources&quot;&gt;
            &lt;DefaultTimePeriod&gt;
              &lt;Type&gt;SpecificDates&lt;/Type&gt;
              &lt;SpecificDateStart&gt;2022-09-15T00:00:00&lt;/SpecificDateStart&gt;
              &lt;SpecificDateEnd&gt;2022-09-15T23:59:59.999&lt;/SpecificDateEnd&gt;
              &lt;RelativeTimeValue&gt;1&lt;/RelativeTimeValue&gt;
              &lt;RelativeTimeType&gt;Days&lt;/RelativeTimeType&gt;
              &lt;RelativeType&gt;TheLast&lt;/RelativeType&gt;
            &lt;/DefaultTimePeriod&gt;
          &lt;/Value&gt;
        &lt;/AnalysisParameter&gt;
      &lt;/AnalysisParameters&gt;
    &lt;/ParameterStoreForSerialization&gt;
  </code></pre>
  <p>I have to change the value of &quot;SpecificDateStart&quot; and &quot;SpecificDateEnd&quot; (tagname is not unique) which is existing multiple times in documents but i have to change at a specific place only which i have attached</p>
  <p>I am using this code</p>
  <pre><code>from xml.etree import ElementTree as ET
  tree = ET.parse(Document.xml)
  tree.find('.//SpecificDateStart').text = '1/1/2011'
  </code></pre>
  <p>This is working but it is changing the first instance of &quot;SpecificDateStart&quot; as the tag name is not unique
  I have to change it at the 3rd or 4th instance for which iam using another code.</p>
  <pre><code>tree.find('/DefaultTimePeriod/SpecificDateStart').text = '1/1/2011'
  </code></pre>
  <p>which is showing me error</p>
  <pre><code>'NoneType' object has no attribute 'text'
  </code></pre>