Anchored Object doesn't support the XML elements in InDesign.
Use the below method.
Places the XML element into a new rectangular page item. If the XML element was already associated with a page item, that page item is deleted.
Parameter Type Description on Spread
The page or spread on which to create the new page item. Can accept: Spread, Page or MasterSpread. geometricBounds Array of Measurement Unit (Number or String)=any The bounds of the page item excluding the stroke width, in the format [y1, x1, y2, x2].