# Xml property?

**URL:** <https://forum.kirupa.com/t/xml-property/228525>\
**Category:** Uncategorized\
**Created:** [June 8, 2007, 3:41pm UTC](https://forum.kirupa.com/t/xml-property/228525 "2007-06-08T15:41:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sasxa](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sasxa](https://forum.kirupa.com/u/sasxa)\
**Post date:** [June 8, 2007, 3:41pm UTC](https://forum.kirupa.com/t/xml-property/228525/1 "2007-06-08T15:41:20Z")

</div>

Is it possible to have property with xml data in my class instance?

i tried

```
[FONT=Courier New][LEFT]package [COLOR=#000000]{[/COLOR]

```

[COLOR=#0000ff]public[/COLOR] [COLOR=#000000] **class** [/COLOR] MyClass [COLOR=#0000ff]extends[/COLOR] Sprite [COLOR=#000000]{[/COLOR]  
[COLOR=#0000ff]public[/COLOR] [COLOR=#000000] **var** [/COLOR] x1:[COLOR=#0000ff]xml[/COLOR];  
[COLOR=#0000ff]public[/COLOR] [COLOR=#000000] **function** [/COLOR] MyClassCOLOR=#000000[/COLOR]:[COLOR=#0000ff]void[/COLOR] [COLOR=#000000]{[/COLOR]  
[COLOR=#808080]_//loading xml_[/COLOR]  
[COLOR=#000000]}[/COLOR]  
[COLOR=#0000ff]private[/COLOR] [COLOR=#000000] **function** [/COLOR] onXMLLoadCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]  
x1 = [COLOR=#000000] **new** [/COLOR] [COLOR=#0000ff]XML[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#000000]}[/COLOR]  
[COLOR=#0000ff]public[/COLOR] [COLOR=#000000] **function** [/COLOR] [COLOR=#0000ff]get[/COLOR] xmlPropertyCOLOR=#000000[/COLOR]:[COLOR=#0000ff]XML[/COLOR] [COLOR=#000000]{[/COLOR]  
[COLOR=#0000ff]return[/COLOR] x1;  
[COLOR=#000000]}[/COLOR]  
[COLOR=#000000]}[/COLOR]  
[COLOR=#000000]}[/COLOR]  
[/LEFT]  
[/FONT]

…create instance of my class

```
[FONT=Courier New][LEFT][COLOR=#000000] **var** [/COLOR] cl:MyClass = [COLOR=#000000] **new** [/COLOR] MyClass[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];

```

[COLOR=#0000ff]trace[/COLOR][COLOR=#000000]([/COLOR]cl.[COLOR=#000080]x1[/COLOR]+[COLOR=#ff0000]" "[/COLOR]+ cl.[COLOR=#000080]xmlProperty[/COLOR][COLOR=#000000])[/COLOR];  
[COLOR=#808080]\*//output: null null \*[/COLOR]

[/LEFT]  
[/FONT]  
is there a way to keep data from xml in my instance?  
btw, code is valid- all imports and stuff are there, just didn’t type all…
