I am able to find a work around for null issue however, nmrao is there anyway by which I can add these new node as the first child of parent node?
As of now it is adding the nodes as the last child nodes -
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.opentravel.org/OTA/2003/05">
<soapenv:Header/>
<soapenv:Body>
<OTA_HotelAvailRQ EchoToken="1234" RateRangeOnly="true" Target="Test" TimeStamp="2006-07-04T09:00:27.1343316+02:00" TransactionIdentifier="b123456789" Version="4.000" xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05 OTA_HotelAvailRQ.xsd" xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<AvailRequestSegments>
<AvailRequestSegment>
<HotelSearchCriteria>
<Criterion>
<RoomStayCandidates>
<RoomStayCandidate Quantity="1">
<GuestCounts>
<GuestCount AgeQualifyingCode="1" Count="1"/>
</GuestCounts>
</RoomStayCandidate>
<HotelRef ChainCode="ABC" HotelCode="03092"/>
<HotelRef ChainCode="ABC" HotelCode="03144"/>
</RoomStayCandidates>
</Criterion>
</HotelSearchCriteria>
</AvailRequestSegment>
</AvailRequestSegments>
</OTA_HotelAvailRQ>
</soapenv:Body>
</soapenv:Envelope>
But I am trying to achieve like below otherwise I am getting an error "cvc-complex-type.2.4.a: Invalid content was found starting with element 'HotelRef'"
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.opentravel.org/OTA/2003/05">
<soapenv:Header/>
<soapenv:Body>
<OTA_HotelAvailRQ EchoToken="1234" RateRangeOnly="true" Target="Test" TimeStamp="2006-07-04T09:00:27.1343316+02:00" TransactionIdentifier="b123456789" Version="4.000" xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05 OTA_HotelAvailRQ.xsd" xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<AvailRequestSegments>
<AvailRequestSegment>
<HotelSearchCriteria>
<Criterion>
<HotelRef ChainCode="ABC" HotelCode="03092"/>
<HotelRef ChainCode="ABC" HotelCode="03144"/>
<RoomStayCandidates>
<RoomStayCandidate Quantity="1">
<GuestCounts>
<GuestCount AgeQualifyingCode="1" Count="1"/>
</GuestCounts>
</RoomStayCandidate>
</RoomStayCandidates>
</Criterion>
</HotelSearchCriteria>
</AvailRequestSegment>
</AvailRequestSegments>
</OTA_HotelAvailRQ>
</soapenv:Body>
</soapenv:Envelope>