# Pass a node of XML to a function

**URL:** <https://forum.kirupa.com/t/pass-a-node-of-xml-to-a-function/266475>\
**Category:** Uncategorized\
**Created:** [July 21, 2008, 8:07am UTC](https://forum.kirupa.com/t/pass-a-node-of-xml-to-a-function/266475 "2008-07-21T08:07:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pier25](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Pier25](https://forum.kirupa.com/u/Pier25)\
**Post date:** [July 21, 2008, 8:07am UTC](https://forum.kirupa.com/t/pass-a-node-of-xml-to-a-function/266475/1 "2008-07-21T08:07:16Z")

</div>

Good monday to all my fellow coders

I have a config XML and I’d like to pass a node (and all it’s child nodes) to a function.

I’m trying

function myFunction(xml:Array)

and

function myFunction(xml:XMLList)

but I always get: Type Coercion failed: cannot convert XML@1cee3da1 element… bla bla bla

So… how can I pass a piece of xml to a function and then use that to do something?

Regards

Pier
