Removing LF from specific line in XML

Hello Guys,

I have an XML file with below sample (just one data record is given below), I am getting LF characters as mentioned in below specific lines. I need to remove those. When I tried, it is removing from complete file instead of those two specific lines.

And to add one LF after one line for each xml record.

Input :



<AMS_DOC_XML_IMPORT_FILE>
<AMS_DOCUMENT DOC_CAT="ABC� DOC_TYP=�ABC� DOC_CD=�xxxx� LF (i am getting LF here)
 DOC_DEPT_CD="4" DOC_UNIT_CD="X" DOC_ID=�yyy� LF (I am getting LF here)
 DOC_VERS_NO="1" AUTO_DOC_NUM="false" DOC_IMPORT_MODE="O">LF
 <ABS_DOC_HDR AMSDataObject=�x�>LF
<DOC_CAT Attribute=�x�><![CDATA[ABS]]></DOC_CAT>LF
<DOC_TYP Attribute=�zz�><![CDATA[ABS]]></DOC_TYP>LF
<DOC_CD Attribute=�bb�><![CDATA[GAX9N]]></DOC_CD>LF

Output :

<AMS_DOC_XML_IMPORT_FILE>LF
<AMS_DOCUMENT DOC_CAT="ABC� DOC_TYP=�ABC� DOC_CD=�xxxx� LF DOC_DEPT_CD="4" DOC_UNIT_CD="X" DOC_ID=�yyy� DOC_VERS_NO="1" 
AUTO_DOC_NUM="false" DOC_IMPORT_MODE="O">LF
<ABS_DOC_HDR AMSDataObject=�x�>LF
<DOC_CAT Attribute=�x�><![CDATA[ABS]]></DOC_CAT>LF
<DOC_TYP Attribute=�zz�><![CDATA[ABS]]></DOC_TYP>LF
<DOC_CD Attribute=�bb�><![CDATA[GAX9N]]></DOC_CD>LF

Thanks in advance.

can you try this awk solution

awk '{if($0~/>$/){print;next}{printf("%s",$0)}}' input.txt

Try also

sed ':L; />$/!{N;bL}; s/\n//g' file