diff --git a/sources/scala/xml/MetaData.scala b/sources/scala/xml/MetaData.scala index 5e55b7fe6..f5e93da05 100644 --- a/sources/scala/xml/MetaData.scala +++ b/sources/scala/xml/MetaData.scala @@ -66,7 +66,11 @@ abstract class MetaData extends Iterable[MetaData] { def elements = new Iterator[MetaData] { var x: MetaData = MetaData.this; def hasNext = Null != x; - def next = x.next; + def next = { + val y = x; + x = x.next; + y + } } /** shallow equals method */