I have a xml file which contains below details:
<server>
<mbean code="WSMQConnectionFactory" name="service=MQQueueConnectionFactory">
<attribute name="JndiName">WSMQQueueConnectionFactory</attribute>
<attribute name="QueueManagerName">QMPMP</attribute>
<attribute name="HostName">10.10.20.21</attribute>
<attribute name="Channel">CHANNEL01</attribute>
<attribute name="TransportType">MQJMS_TP_CLIENT_MQ_TCPIP</attribute>
<depends>jboss:service=Naming</depends>
</mbean>
</server>
I want to search for a "HostName" attribute and add new attribute(port) after it. It should look like this :
<server>
<mbean code="WSMQConnectionFactory" name="service=MQQueueConnectionFactory">
<attribute name="JndiName">WSMQQueueConnectionFactory</attribute>
<attribute name="QueueManagerName">QMPMP</attribute>
<attribute name="HostName">10.10.20.21</attribute>
<attribute name="Port">1414</attribute>
<attribute name="Channel">CHANNEL01</attribute>
<attribute name="TransportType">MQJMS_TP_CLIENT_MQ_TCPIP</attribute>
<depends>jboss:service=Naming</depends>
</mbean>
</server>
Please suggest