export function getChildren ( parent ) { if ( [ 'LDevice' , 'Server' ] . includes ( parent . tagName ) ) return Array . from ( parent . children ) . filter ( child => child . tagName === 'LDevice' || child . tagName === 'LN0' || child . tagName === 'LN' ) ; const id = parent . tagName === 'LN' || parent . tagName === 'LN0' ? parent . getAttribute ( 'lnType' ) : parent . getAttribute ( 'type' ) ; return Array . from ( parent . ownerDocument . querySelectorAll ( `LNodeType[id="${ id }"] > DO, DOType[id="${ id }"] > SDO, DOType[id="${ id }"] > DA, DAType[id="${ id }"] > BDA` ) ) ; }