export type Xml = any ; param xml param name returns example export function getXmlAttributeValue ( xml , name ) { try { return xml . $ [ name ] ; } catch ( err ) { } } param xml param name returns example export function getXmlElement ( xml , name ) { try { const element = xml [ name ] ; if ( element instanceof Array ) { return element [ 0 ] ; } } catch ( err ) { } } param xml param elementName param attributeName example export function getXmlElementAttributeValue ( xml , elementName , attributeName = "DefaultValue" ) { const element = getXmlElement ( xml , elementName ) ; if ( element ) { return getXmlAttributeValue ( element , attributeName ) ; } } param xml param name returns example export function getXmlElements ( xml , name ) { try { const elements = xml [ name ] ; return elements instanceof Array ? elements : [ ] ; } catch ( err ) { return [ ] ; } } param xml param name example export function getXmlElementsAttributeValue ( xml , name , itemElementName , attributeName = "DefaultValue" ) { const values = [ ] ; try { const xmlElements = xml [ name ] [ 0 ] [ itemElementName ] ; xmlElements . forEach ( ( xmlElement ) => { const elementValue = getXmlAttributeValue ( xmlElement , attributeName ) ; if ( elementValue !== undefined ) { values . push ( elementValue ) ; } } ) ; } catch ( err ) { } return values ; } param xml param name example export function getXmlElementsValue ( xml , name , itemElementName ) { const values = [ ] ; getXmlElements ( xml , name ) . forEach ( ( xmlElement ) => { const elementValue = getXmlElementValue ( xmlElement , itemElementName ) ; if ( elementValue !== undefined ) { values . push ( elementValue ) ; } } ) ; return values ; } param xml param name example export function getXmlElementValue ( xml , name ) { try { const element = xml [ name ] ; if ( element instanceof Array ) { return element [ 0 ] ; } } catch ( err ) { } } param xml param elementName param attributeValue param attributeName export function setXmlElementAttributeValue ( xml , elementName , attributeValue , attributeName = "DefaultValue" ) { xml [ elementName ] [ 0 ] . $ [ attributeName ] = attributeValue ; } param xml param elementName param elementValue export function setXmlElementValue ( xml , elementName , elementValue ) { xml [ elementName ] = elementValue ; }