title: xmlparsing in jenkins script using XMLParser
body: <p>I am trying to read the server name from the xml file in a pipeline script.</p>
  
  <p><strong>My Code:</strong></p>
  
  <pre><code>node {
  
     def str = "&lt;root&gt;&lt;HTTPTargetConnection&gt;&lt;Loadbalancer&gt;&lt;server name=\"myserver\" /&gt; &lt;/Loadbalancer&gt;&lt;/HTTPTargetConnection&gt;&lt;/root&gt;";
  
     def rootNode = new XmlParser().parseText(str);
  
     echo rootNode.HTTPTargetConnection.Loadbalancer.server.@name.value[0];
  
  }
  </code></pre>
  
  <p><strong>Exception:</strong>
  [Pipeline] End of Pipeline
  *</p>
  
  <blockquote>
    <p>org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException:
    unclassified field groovy.util.Node HTTPTargetConnection  at
    org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.unclassifiedField(SandboxInterceptor.java:367)
      at
    org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:363)
      at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:241)</p>
  </blockquote>
  
  <p>Please help me in resolving this issue.</p>