title: How to get the element value in two sections in xml but ignore if any one of the section has empty element value in groovy
body: <p>We need to get the number element values from the services (there are two service sections). if it(number element) has the value in any of the service then it should take those values and if none of the services don't have number value then it should throw the exception. Please help me.</p>
  
  <pre><code>&lt;service&gt;
          &lt;serviceAlias&gt;xxxx/4321&lt;/serviceAlias&gt;
              &lt;Elements&gt;
                  &lt;Element&gt;
                      &lt;name&gt;host&lt;/name&gt;
                      &lt;Interfaces&gt;
                          &lt;Interface&gt;
                              &lt;number&gt;123&lt;/number&gt;
                          &lt;/Interface&gt;
                          &lt;Interface&gt;
                              &lt;number&gt;123&lt;/number&gt;
                          &lt;/Interface&gt;
                          &lt;Interface&gt;
                              &lt;number&gt;123&lt;/number&gt;
                          &lt;/Interface&gt;
                      &lt;/Interfaces&gt;
                  &lt;/Element&gt;
              &lt;/Elements&gt;
  &lt;/service&gt;
  &lt;service&gt;
          &lt;serviceAlias&gt;xxxx/1234/&lt;/serviceAlias&gt;
              &lt;Elements&gt;
                  &lt;Element&gt;
                      &lt;name&gt;host&lt;/name&gt;
                      &lt;Interfaces&gt;
                          &lt;Interface&gt;
                              &lt;number /&gt;
                          &lt;/Interface&gt;
                          &lt;Interface&gt;
                              &lt;number /&gt;
                          &lt;/Interface&gt;
                          &lt;Interface&gt;
                              &lt;number /&gt;
                          &lt;/Interface&gt;
                      &lt;/Interfaces&gt;
                  &lt;/Element&gt;
              &lt;/Elements&gt;
  &lt;/service&gt;
  </code></pre>