---
sourceDocument: Yokohama Platform security
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/yokohama/platform-security

 Release :

    - yokohama

ft:locale :

    - en-US

ft:publication_title :

    - Yokohama Platform security

ft:clusterId :

    - psec

bundleId :

    - psec

workflow :

    - Platform


---

# XMLElementIterator

# XMLElementIterator {#ariaid-title1}

Release version: Yokohama  
Updated January 30, 2025  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read  
Provides methods for iterating over XML elements.

You get an XMLElementIterator object by calling the
getIterator() method of the XMLContent class.

## XMLElementIterator - hasNext() {#ariaid-title2}

Determines if there is another element available.
{#r_XMLEI-hasNext__table_f14_rmt_st__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 1. Parameters]

{#r_XMLEI-hasNext__table_f14_rmt_st} {#r_XMLEI-hasNext__table_g14_rmt_st__entry__2}

| Type | Description |
|-|-|
| Boolean | True if another element is available. |
[Table 2. Returns]

{#r_XMLEI-hasNext__table_g14_rmt_st}

## XMLElementIterator - next() {#ariaid-title3}

Returns the next element in the iterator.
You cannot call next() without first calling
hasNext().
{#r_XMLEI-next__table_sb5_dnt_st__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 3. Parameters]

{#r_XMLEI-next__table_sb5_dnt_st} {#r_XMLEI-next__table_tb5_dnt_st__entry__2}

| Type | Description |
|-|-|
| XMLElement | The next XML element. |
[Table 4. Returns]

{#r_XMLEI-next__table_tb5_dnt_st}

