Remove Empty attributes and elements

I have an xml document with null attributes and elements… how do i remove these from the document in webmethods

Document example

[COLOR=#008080]<?xml version="1.0"?>
<LOAN_PRODUCT_DATA>
<LOAN_FEATURES NameDocumentsDrawnInType="" AssumabilityIndicator="" BalloonIndicator=“1” />
<Loan_data/>
</LOAN_PRODUCT_DATA>

I want the above xml to be converted to

<?xml version="1.0"?>
<LOAN_PRODUCT_DATA>
<LOAN_FEATURES BalloonIndicator=“1” />
</LOAN_PRODUCT_DATA>
[/COLOR]

I believe we cant remove the attributes as long as they exist in your document structure (DTD or Schema).But if you are creating xml string then try not to map the attributes when attribute value is null.If the xml is passed to you by other source then as a crude solution you can using with replace service?? map xmldata to replace string and specify search criteria and replace with nothing.

HTH,
RMG

If you are producing the first document in webMethods, just add logic to not map any values to the attributes if the source is null.

You can also try converting the xml string to a document built from a document reference and then back to a string.

Mark